我有两个不同版本的git。
在1.6.2版本中,git push没有-u选项。它只出现在1.7版本中。x版本。
在文档中,-u与变量有关
branch.<name>.merge
在git配置中。该变量描述如下:
Defines, together with branch.<name>.remote, the upstream branch
for the given branch. It tells git fetch/git pull which branch to merge.
什么是上游分支?
这不再是最新的!
Push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.
Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.
对于最新的或成功推送的每个分支,添加upstream(跟踪)引用,用于无参数git-pull和其他命令。所以,在用-u选项推你的本地分支之后,这个本地分支会自动链接到远程分支,你可以不带任何参数地使用git pull。
这不再是最新的!
Push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.
Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.
对于最新的或成功推送的每个分支,添加upstream(跟踪)引用,用于无参数git-pull和其他命令。所以,在用-u选项推你的本地分支之后,这个本地分支会自动链接到远程分支,你可以不带任何参数地使用git pull。