如何将新的本地分支推送到远程Git存储库并对其进行跟踪?我希望能够做到以下几点:基于其他(远程或本地)分支创建本地分支(通过git branch或git checkout -b)将本地分支推送到远程存储库(发布),但使其可跟踪git pull和git push马上就会起作用。我该怎么做?我知道--set-upstream在Git 1.7中,但这是一个创建后的动作.在将分支推到远程存储库时,我希望找到一种进行类似更改的方法。
3 回答

慕容3067478
TA贡献1773条经验 获得超3个赞
--set-upstream
git push --all -u

一只名叫tom的猫
TA贡献1906条经验 获得超3个赞
git push -u
git push
$ git checkout -b branchB $ git push origin branchB:branchB
git config
.git/config
$ git config branch.branchB.remote origin $ git config branch.branchB.merge refs/heads/branchB
.git/config
[branch "branchB"] remote = origin merge = refs/heads/branchB
- 3 回答
- 0 关注
- 1480 浏览
添加回答
举报
0/150
提交
取消