我一直在使用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?
如果我在一个客户端上更改它,我是否需要在我共享回购的其他客户端上做任何事情?
我是GitHub的新手.今天我在尝试将代码推送到GitHub时遇到了一些问题.
Pushing to git@github.com:519ebayproject/519ebayproject.git
To git@github.com:519ebayproject/519ebayproject.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:519ebayproject/519ebayproject.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Run Code Online (Sandbox Code Playgroud)
我还没有在存储库中推送任何东西,为什么我需要拉东西呢?
从功能上讲,在分散的工作流程中,我没有看到配置设置simple和current选项之间的区别push.default.
current将当前分支推送到指定远程上的同名分支.simple对于当前分支的跟踪和任何未跟踪的遥控器,它将有效地做同样的事情(它在两种情况下都强制执行相同的分支名称).
有人可以解释我失去的分散工作流程之间的任何重要差异吗?
我刚刚提交了我的工作树,首先添加到索引,使用"$ git commit -m'test'"我将stdout-put从此保存到文件中,我在顶部看到它说
# On branch master
# Changed but not updated:
# (use "git add/rm ..." to update what will be commited)
# (use "git checkout -- ..." to discard changes in working directory)"
Run Code Online (Sandbox Code Playgroud)
问题是我的工作树没有被提交给回购,我觉得这与它有关
谢谢
远程跟踪分支的名称和跟踪的相应远程分支是否必须相同?
如果它们可以有不同的名称,那么git fetch两个分支如何匹配呢?(典型refspec的git fetch是+refs/heads/*:refs/remotes/remote/*)
如果我是正确的,给定远程跟踪分支,我们可以创建一个与之关联但具有不同分支名称的本地跟踪分支.(通过-b选项git checkout)
此外,如果跟踪的远程跟踪分支和相应的远程分支的名称相同,那么如何
git push匹配本地跟踪分支和远程分支?(典型refspec的git push是+refs/heads/*:refs/heads/*)
Git版本:1.7.12.3
正如问题所述,这对我来说似乎是一个非常糟糕的主意.没有任何额外的标志或确认git push -f将强制将所有跟踪分支推送到远程.
如果开发人员有一些过时的分支,即跟踪遥控器,并且他执行该命令,则所有跟踪分支都将回滚到他过时的副本,这会导致丢失有价值的工作.
这可能是偶然发生的,或者是由git经验不足的人完成的.看起来git应该在这样一个危险的情况下做更多的手持,并需要一个额外的标志,或要求确认.
这有补救措施吗?