Reputation: 5379
There are a few branches branches (master, test1, test2,)
I have just cloned the whole repository and would like to 'sync' test1 and test2 branches. Remotely, test1 has the desired content, test2 is out of date. I would like to:
So in other words how would I pull the contents of test1 and put it in test2 (destroying all the current content of test2).
Upvotes: 0
Views: 3355
Reputation: 46667
I'd probably do:
git branch -d test2 # Delete test2 locally
git checkout test1
git checkout -b test2 # Recreate test2 locally from test1
git push -f # Forcibly bring remote test2 into step
But do remember the usual caveat; if other people have the upstream test2
, then overwriting its history is not very friendly.
Upvotes: 2