Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 398 Bytes

git-la-qu-zhi-ding-tag-fen-zhi-de-dai-ma.md

File metadata and controls

23 lines (17 loc) · 398 Bytes

git拉取指定tag/分支的代码

  • 新建目录
mkdir workspace
  • 初始化
cd workspace
git init .
git remote add origin [email protected]:kennethfan/docker-compose-tool.git
  • 拉取分支/tag代码
git fetch --tags +refs/heads/*:refs/remotes/origin/*
commit=$(git rev-parse origin/${tag}^{commit}) # ${tag} 替换成对应域名
git checkout -f $commit