我一直在使用Git一段时间,并且最近只下载了一个更新,以便在我尝试时发现此警告消息push.
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
Run Code Online (Sandbox Code Playgroud)
我显然可以将它设置为所提到的值之一,但它们是什么意思?simple和之间有什么区别matching?
如果我在一个客户端上更改它,我是否需要在我共享回购的其他客户端上做任何事情?
我使用以下命令推送到我的远程分支:
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]只会将该分支推送到远程.
有什么区别:
$ git remote add origin git@github.com:yourname/yourproject.git
$ git config remote.origin.push refs/heads/master:refs/heads/master
$ git push
Run Code Online (Sandbox Code Playgroud)
和:
$ git remote add origin git@github.com:yourname/yourproject.git
$ git push origin master -u
Run Code Online (Sandbox Code Playgroud)
第二个版本是否比第一个版本更新更短,还是有其他差异?
从Git 1.7.0开始,您可以使用该--set-upstream选项git push.根据git push手册:
Run Code Online (Sandbox Code Playgroud)-u, --set-upstream For every branch that is up to date or successfully pushed, add upstream (tracking) reference, used by argument-less git-pull(1) and other commands. For more information, see branch.<name>.merge in git-config(1).