混帐 : how to specify a default remote push-to branch?

标签 git git-push remote-branch

假设我有一个名为“abc”的跟踪分支,它跟踪 origin/master

当我在 'abc' 上执行 git push 时,它会将 'abc' 推送到 'abc'.
如何仅使用“git push”为其指定远程推送分支?

最佳答案

git branch --set-upstream-to abc origin/master

应该可以指定远程分支。

注意 -to added to --set-upstream since git1.8.0 .

Git1.7.0 :

"git branch --set-upstream" can be used to update the (surprise!) upstream, i.e. where the branch is supposed to pull and merge from (or rebase onto).

关于混帐 : how to specify a default remote push-to branch?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3599412/

相关文章:

git - Git LFS 和 git-annex 有何不同?

php - "git push appengine master"中需要用户名和密码

git - 如何从错误的 git push -f origin master 中恢复?

Git推送需要用户名和密码

Git checkout : updating paths is incompatible with switching branches

Git - 将 .git 目录移动到另一个驱动器,将源代码保留在原处

Git FULL Push ,没有引用文献?

git - 列出master后面的所有远程分支

git - 配置本地分支以推送到特定分支

git - 在 Makefile 中,如何获取 git commit 哈希并将其分配给变量?