我想将这些行添加到 git config。我需要一个命令行解决方案。
[branch "master"]
remote = origin
merge = refs/heads/master
git config branch.master.remote origin设置值remote。
git config branch.master.merge refs/heads/master设置值merge。
git config branch.master.remote读取值。
可git config用于编辑任何值。规则很简单。我举例说明。生成这样git config a.b.c.d.e.f 42的配置部分:
[a "b.c.d.e"]
f = 42
在 git 版本1.7.0之前,您需要这样做:
git config branch.master.remote origin
git config branch.master.merge refs/head/master
从 git 1.7.0 及更高版本开始,您可以这样做:
git branch --set-upstream master origin/master
他们做同样的事情。