Adding two repos to git config, how can I automatically fetch both after a push? -
what way fetch branches (to check consistency via branch -av between both repos) in [remote "all"] after push? have fetch both origin , backup, it's fetching first.
[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 = merge = refs/heads/master i'm going route of typing git push [branch], followed git fetch all since fetch it's automatically grabbing first repo listed in [remote "all"] (even though have both listed.)
you can't fetch. (you can push, still advise against it. if want keep all, i'd @ least recommend setting url invalid , setting push urls via pushurl—although admit have never tested setup.)
what can , should instead declare multiple remotes (as did, remote origin , remote backup) , declare remote group described in the git remote documentation. default group named default, , if not define one, git remote update defaults finding all remotes automatically, skipping configured special "i not in default set" flag.
hence, delete all repo , instead of running git fetch, run git remote update (or git fetch --all). (or leave all in there pushing, ocd still says "don't that" :-) )
Comments
Post a Comment