3
I created a new Feature in the master branch and would like to isolate it in a new branch.
Also, after creating the new branch, I’d like to reset my local master branch to the remote master branch.
I created this new local branch, which turns out to be a copy of the master local branch (already including my Feature), now I don’t quite understand how to reset only my master site to look exactly like the remote master.
I need to do this in order to commit and push the master without changing the application in production with this new Feature, which is not yet completed.
I hope I have been clear, that my goal is only to give a reset on the master and not on the others.
Thank you.
You committed some commit in master with these changes?
– Marcelo de Andrade
Not yet. I started developing this Feature and I didn’t commit anymore. It was a mistake not to have isolated it in a new branch (that’s why I wanted to do it now). My remote master branch has nothing to do with this change.
– Antoniazzi
So you just do one
git checkout -b feature
to create a new branch with Features from the master and commit from there. When to return to thebranch master
he will be as theremote master
.– Marcelo de Andrade
@Marcelodeandrade, I didn’t understand how my local master will look like the remote (returning to the remote master state). Is it because when commiting only the Feature branch the master site will lose the changes? I really didn’t understand this part.
– Antoniazzi
Give a read on the answer.
– Marcelo de Andrade