bero
bero

Reputation: 201

Pass all files from a branch to another

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

Answers (1)

scrowler
scrowler

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

Related Questions