6
Help!
If anyone’s been there or knows how to help, I’ll thank you.
- created a branch:
git branch <xxxx>
- changed to new branch:
git checkout xxxx
- I changed a file line inside the branch
xxxx
- I returned to the master branch:
git checkout master
- Thread ==> changes made to branch
xxxx
appear in themaster
Out of command git checkout master
:
$ git checkout master
M WebContent/_footer.jsp
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
Is doing the merge automatic. Is this normal or was it an installation error? Does anyone know how to disable if this is a mistake?
EDIT: Guys, I appreciate the help, but it’s still unclear.
I was sure the changes in my branch xxxx
would only appear on my branch master
when I executed the command git merge xxxx
, what was not the case.
You see, by simply switching branches he did the merge automatic and that’s exactly merge automatic that I don’t want, someone else to help?
Or he can commit the changes or play pro stash too. (:
– Felipe Avelar
@Felipeavelar Well remembered, I added in the reply.
– Fernando Silveira
Or git checkout -- :/
– MasterID
@Masterid You’re right, added.
– Fernando Silveira
This isn’t automatic! You must not have made the branch change... Are you sure you created the branch correctly? Sure it was for the right branch to make the change?
– egomesbrandao
@Yes, it’s automatic because he didn’t
commit
of the change. Try:git reset --hard HEAD && git checkout -b foo && echo foo > arquivo-ja-versionado-previamente && git checkout master && git status
– Fernando Silveira