我一直在使用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推送到"匹配"分支 - 具有相同名称的分支,而不是"上游"分支 - 正在跟踪的分支.我可以更方便地切换到"上游"模式,这样我就不必每次都指定我正在推送的分支,但我认为'匹配'是默认的原因.是否有任何问题将设置设为"匹配",而不是"上游"设置将解决?
我的目标是删除 github 上所有提交中的一个文件,因此我执行了后续步骤:
我用这个命令过滤了我的分支:
git filter-branch --index-filter 'git rm --cached --ignore-unmatch [file_name]' HEAD
Run Code Online (Sandbox Code Playgroud)
在所有提交中删除一个文件,现在在运行后删除一个文件
git status
Run Code Online (Sandbox Code Playgroud)
它要求我拉,
ubuntu@ubuntu:/var/www/html/laravel/app_folder$ git status
On branch master
Your branch and 'origin/master' have diverged,
and have 18 and 18 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
nothing to commit, working directory clean
Run Code Online (Sandbox Code Playgroud)
但我不想拉。我担心如果我拉出,我的提交中会再次出现这个文件。
难道我现在不应该推送它以便更改在我的 git hub 上生效吗……我不知道该怎么做。