How to sync git remotes
I managed to mess up my remotes and would like to get back in sync with origin. I have previously deleted all remotes and have manually re-added them.
My remotes are:
$ git remote -v show origin https://github.com/rapid7/metasploit-framework (fetch) origin https://github.com/rapid7/metasploit-framework (push) truekonrads email@example.com:truekonrads/mriv-metasploit.git (fetch) truekonrads firstname.lastname@example.org:truekonrads/mriv-metasploit.git (push)
I would like to update origin/master to latest version and then merge truekonrads/mirv-events branch into master. How do I do it?
is it possible to do it in a fashion that github keeps track of origin?
One Solution collect form web for “How to sync git remotes”
To “update origin/master to latest version”:
git fetch origin master
To “merge truekonrads/mirv-events branch into master”:
git checkout master git merge truekonrads/mirv-events
Not sure what you mean by github keeping track of origin. Your local repository is keeping track of
origin. You could
git remote add github <URL>; git push github origin/master:latest_origin_master to push a copy of
origin/master up to github for safekeeping under the name
latest_origin_master, but it’s not clear if that’s what you’re wanting, especially since both
truekonrads are already on github.
Given your output above, it seems that
truekonrads are defined identically, which is redundant.