What would be the opposite of "git fetch"? -
if git fetch repo a b, master branch in b doesn't change - changes remotes/origin/master, , git status reminds me of it.
but want opposite - update b a, pushing a:master b:remotes/origin/master. reason this update happens on ssh, , a machine has public-key auth b machine - not vice versa.
how can this?
git fetch a, run b, store current branches of a in refs/remotes/a. can pretty refspecs, it's possible same git push, run a , targeting b.
a refspec has 2 parts, separated semicolon. in first part select want push. here want current branches, refs/heads/*.
second part you'll store them on remote; here want store them under remotes/a/*, refs/remotes/a/*.
put together, push local branches corresponding remote branches command:
git push --force b refs/heads/*:refs/remotes/a/*
Comments
Post a Comment