Reputation: 201
I have a git repository with two branches: master and master2. If I want to pass all existing files from master to master2, what command should i use? I tried whit this but it didn't work
git checkout master2
git checkout master files
git commit -m 'Add file files to master2.'
Upvotes: 0
Views: 356
Reputation: 24425
You have different options available:
Merge over the top:
git checkout master2
git merge master
Rebase underneath:
git checkout master2
git rebase master
Reset to an exact copy (including VCS history):
git checkout master2
git reset --hard master
Upvotes: 2