相关疑难解决方法(0)

警告:push.default未设置; 它的隐含值在Git 2.0中发生了变化

我一直在使用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 version-control

1615
推荐指数
3
解决办法
25万
查看次数

为什么我不能推到这个裸存储库?

你能解释一下这个工作流程有什么问题吗?

$ 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

281
推荐指数
5
解决办法
18万
查看次数

git push.default = current和push.default = upstream有什么区别?

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中的男子页面已经更新(如人们所期望的),这样的区分做出可能是一个更加清晰了.

git git-push git-branch

85
推荐指数
2
解决办法
5万
查看次数

标签 统计

git ×3

git-branch ×1

git-push ×1

version-control ×1