How to copy contents of one branch to other branch?

Assuming you want to overwrite all the contents of InitialPomChanges with what is in develop (i.e. you want the contents of InitialPomChanges to exactly match develop), do the following:

git checkout InitialPomChanges
git checkout develop .  #copies the contents of develop into the working directory
git commit -am "Making InitialPomChanges match develop"

This will make the last commit in InitialPomChanges match the last commit in develop. To make future merges between the two branches easier, it would be a good idea to now do a git merge develop.

Alternatively, if you want to change the contents of InitialPomChanges and do the merge in one single commit, you can do:

git checkout InitialPomChanges
git merge -s theirs develop

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)