我一直在使用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 init --bare bare
Initialized empty Git repository in /work/fun/git_experiments/bare/
$ git clone bare alice
Cloning into alice...
done.
warning: You appear to have cloned an empty repository.
$ cd alice/
$ touch a
$ git add a
$ git commit -m "Added a"
[master (root-commit) 70d52d4] Added a
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 a
$ git push
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch …Run Code Online (Sandbox Code Playgroud) git-config的手册页列出了push.default的这些选项:
nothing - do not push anything.
matching - push all matching branches. All branches having the same name in both ends are considered to be matching. This is the default.
upstream - push the current branch to its upstream branch.
tracking - deprecated synonym for upstream.
current - push the current branch to a branch of the same name.
Run Code Online (Sandbox Code Playgroud)
在大多数情况下,我会假设推送到分支的上游分支与推送到同名分支相同,因为上游分支通常具有相同的名称,并且因为同名的分支("当前" )通常(或总是按定义?)是上游.那有什么区别?
UPDATE:为的git-config中的男子页面已经更新(如人们所期望的),这样的区分做出有可能是一个更加清晰了.