我与 Gerritt 合作,需要一些帮助来自动执行代码检查过程中的手动步骤。这是背景。当我重新克隆我的存储库时,这是我在 Git 配置(在 .git 文件夹内)中看到的内容。
[remote "origin"]
url = https://[email protected]/contentpipeline.git
fetch = +refs/heads/*:refs/remotes/origin/*
我们在 git 配置中手动进行以下更改。 (参考第二行)
[remote "origin"]
push = +refs/heads/MYBRANCH:refs/for/MYBRANCH
url = https://[email protected]/contentpipeline.git
fetch = +refs/heads/*:refs/remotes/origin/*
添加带有推送的行,以便更改不会直接推送到 MYBRANCH,而是被视为“推送以供审核”。
我有两个问题:
非常感谢, 普拉巴尔
可以使用
git config [path.to.setting] [value]
添加 git config 中的任何设置。
您的情况:
git config remote.origin.push +refs/heads/MYBRANCH:refs/for/MYBRANCH
为了说明:
# after running:
git config foo.bar.baz Hello
# I get:
cat .git/config | tail -2
# [foo "bar"]
# baz = Hello