推送后branch -av
中获取所有分支(通过[remote "all"]
之间的origin
检查一致性)的好方法是什么?我对backup
和[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = git@host:origin/repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "backup"]
url = git@host:backup/repo.git
fetch = +refs/heads/*:refs/remotes/backup/*
[remote "all"]
url = git@host:origin/repo.git
url = git@host:backup/repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/heads/*:refs/remotes/backup/*
[branch "master"]
remote = all
merge = refs/heads/master
都进行了抓取,但它只获取第一个。
git push all [branch]
我目前正在键入git fetch all
,然后是[remote "all"]
,因为它自动抓取的唯一提取是TXMLDocument
中列出的第一个回购(即使我已列出。)
答案 0 :(得分:2)
您无法为fetch
执行此操作。 (您可以push
,但我仍然反对。如果您想保留all
,我至少建议您将url
设置为无效并设置通过pushurl
推送网址 - 虽然我承认我从未测试过此设置。)
您可以而且应该做的是声明多个遥控器(就像您所做的那样,远程origin
和远程backup
)然后声明远程组< / em>如the git remote
documentation中所述。默认组名为default
,如果您没有定义一个,git remote update
默认自动查找所有遥控器,仅跳过配置了特殊&#34; I的那些我不在默认设置中#34;标志。
因此,只需删除all
回购,而不是运行git fetch
,运行git remote update
(或git fetch --all
)。 (或者让all
留在那里进行推动,但我的强迫症仍然说'不要那样做&#34; :-))