相关疑难解决方法(0)

没有指定分支的"git push"的默认行为

我使用以下命令推送到我的远程分支:

git push origin sandbox
Run Code Online (Sandbox Code Playgroud)

如果我说

git push origin
Run Code Online (Sandbox Code Playgroud)

这会推动我的其他分支的变化,还是只更新我当前的分支?我有三个分支:master,productionsandbox.

git push文件是不是这个很清楚,所以我想澄清这一点为好.

哪些分支和遥控器可以git push完全更新以下命令?

git push 
git push origin
Run Code Online (Sandbox Code Playgroud)

origin 上面是一个遥控器.

据我所知,git push [remote] [branch]只会将该分支推送到远程.

git branch git-push git-branch

1339
推荐指数
10
解决办法
62万
查看次数

如何抑制"致命:当前分支的上游分支与当前分支的名称不匹配"?

在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.当我这样做时,我收到以下消息:

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
Run Code Online (Sandbox Code Playgroud)

git即使名称不匹配,如何强制自动推送到上游分支?我正在使用git 1.9.1

git

4
推荐指数
1
解决办法
3376
查看次数

标签 统计

git ×2

branch ×1

git-branch ×1

git-push ×1