我有一个主分支和一个搜索功能分支在我的项目中。我已经将搜索功能分支推送到远程仓库,到目前为止都很好。
今天早上我在那个分支上工作时,我执行了“git push”命令,结果得到以下提示:
今天早上我在那个分支上工作时,我执行了“git push”命令,结果得到以下提示:
warning: You did not specify any refspecs to push, and the current remote
warning: has not configured any push refspecs. The default action in this
warning: case is to push all matching refspecs, that is, all branches
warning: that exist both locally and remotely will be updated. This may
warning: not necessarily be what you want to happen.
warning:
warning: You can specify what action you want to take in this case, and
warning: avoid seeing this message again, by configuring 'push.default' to:
warning: 'nothing' : Do not push anything
warning: 'matching' : Push all matching branches (default)
warning: 'tracking' : Push the current branch to whatever it is tracking
warning: 'current' : Push the current branch
所以我执行了git config push.default tracking命令,然后git push就可以正常工作了,没有问题,也没有警告。
我不理解"current"和"tracking"之间的区别是什么,如果你不将其“跟踪到任何地方”,那么“current”的意义是什么——它会去哪里?在哪些情况下会使用current而不是tracking?
此外,有哪些情况下会使用“nothing”?