我使用以下命令推送到我的远程分支:
git push origin sandbox
Run Code Online (Sandbox Code Playgroud)
如果我说
git push origin
Run Code Online (Sandbox Code Playgroud)
这会推动我的其他分支的变化,还是只更新我当前的分支?我有三个分支:master,production和sandbox.
该git push文件是不是这个很清楚,所以我想澄清这一点为好.
哪些分支和遥控器可以git push完全更新以下命令?
git push
git push origin
Run Code Online (Sandbox Code Playgroud)
origin 上面是一个遥控器.
据我所知,git push [remote] [branch]只会将该分支推送到远程.
在SO上有一个相关的问题,涉及如何更改push命令的参数以避免此消息:
我对如何压制消息本身感兴趣,而不更改本地/远程分支的名称或使用花哨的push命令.
假设我有一个本地分支跟踪一个不同名称的远程分支:
user@home:~ git branch -vv
branch-name abcd1234 [remote/origin/branch-name] last commit message
Run Code Online (Sandbox Code Playgroud)
现在我想通过简单的输入来推动我的提交更改git push.当我这样做时,我收到以下消息:
Run Code Online (Sandbox Code Playgroud)fatal: The upstream branch of your current branch does not match the name of your current branch. To push to the upstream branch on the remote, use git push origin HEAD:remote/origin/branch-name To push to the branch of the same name on the remote, use git push origin branch-name
git即使名称不匹配,如何强制自动推送到上游分支?我正在使用git 1.9.1