Reputation: 13118
I have created a new branch with some changes in it, I would like to still have the new branch but identical to the master branch. Is it possible to "override" a branch with another one's content?
Thanks in advance.
Upvotes: 2
Views: 2239
Reputation: 27325
This is one of the main functions of GIT. Merge the content of the master branch in your feature branch and you have have all changes from the master in it but with your changes you made in your feature branch.
git merge master
if you don't need the changes of your feature branch then reset the branch to the master branch.
git reset --hard master
Or what is much easier make a new branch from the master.
Upvotes: 1
Reputation: 725
it is indeed in the git console go to the branche you want to override and type
git reset --hard <branch name>
it will override the branch you are on with the content of <branch name>
Upvotes: 5