克隆的git配置 [英] git config that gets cloned
问题描述
在完成 git clone git @ somewhere:something.git
后,目标是如此:<$> c $ c> something / .git / config 将包含
[push]
默认=追踪
不需要克隆人做 cd something; git config push.default tracking
因此,当不带参数地推送时,他/她不会意外推送所有分支(不,没有人读取自述文件)。
(关于2012年初的这一日期的讨论,如 git push
当前分支)
它会从当前默认一个:
匹配
- 推送所有分支两端具有相同的名称。
这对于那些将所有分支准备为可发布形状,然后使用单个命令将其推出的人员。
它是不适合推入多个用户共享的存储库,因为如果其他用户更新了分支,本地停止的分支将尝试进行非快速前进推送。
这是当前的默认值,但Git 2.0会将默认值更改为simple
。
对于新的名为 简单
:
上游
- 将当前分支推送到它的上游分支。
通过这个,git push
将更新与git pull合并的远程参考相同的远程参考,推拉对称。有关如何配置上游分支的信息,请参阅分支。< name> .merge
。
简单
- 与上游一样,但拒绝推送,如果上游分支的名称与本地名称不同。
最安全的选择,非常适合初学者。它将成为Git 2.0中的默认设置。
The goal is so after doing git clone git@somewhere:something.git
The resulting something/.git/config
will contain
[push]
default = tracking
without requiring the cloner to do cd something; git config push.default tracking
so he/she won't accidentally push all branches when pushing without argument (No, nobody reads the README).
Since it is difficult to enforce policy on the downstream or client side (which is dangerous, as knittl comments), the upcoming Git 2.0 recognizes that fact and will change the default push policy.
(The discussions on this date from early 2012, as illustrated in "git push
current branch")
It will go from the current default one:
matching
- push all branches having the same name in both ends.
This is for those who prepare all the branches into a publishable shape and then push them out with a single command.
It is not appropriate for pushing into a repository shared by multiple users, since locally stalled branches will attempt a non-fast forward push if other users updated the branch.
This is currently the default, but Git 2.0 will change the default tosimple
.
To the new one, called "simple
":
upstream
- push the current branch to its upstream branch.
With this,git push
will update the same remote ref as the one which is merged by git pull, making push and pull symmetrical. See "branch.<name>.merge
" for how to configure the upstream branch.
simple
- like upstream, but refuses to push if the upstream branch's name is different from the local one.
This is the safest option and is well-suited for beginners. It will become the default in Git 2.0.
这篇关于克隆的git配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!