美文网首页
git 按需拉取

git 按需拉取

作者: u14e | 来源:发表于2020-04-08 22:51 被阅读0次

普通的方式

拉取的是所有分支的代码:

git clone -b dev https://github.com/vuejs/vuex.git
image.png

基于远程分支(master)新建本地分支(master): git checkout master

最小化拉取的方式(按需拉取)

只拉取 dev 分支的代码:

git clone --single-branch -b dev https://github.com/vuejs/vuex.git
image.png

基于远程分支新建本地分支:

git remote set-branches origin --add master
git fetch origin master
git checkout master
image.png

参考链接:

相关文章

网友评论

      本文标题:git 按需拉取

      本文链接:https://www.haomeiwen.com/subject/kphfmhtx.html