I have a local branch features
that I based off of my local master
to add some stuff in my code. I am now ready to merge those back into master
, however, the state of the remote master
branch has changed since then.
How can I get the latest version of master and then add my changes on top of that, so that I can then make a pull request to my remote master
branch.
I read a couple of similar articles here, but all of them gave different answers and I got confused.
Should I first "switch" to my master branch, do a git pull
and then somehow merge my features
branch into it (resolving any conflicts), or is there another way.
Some articles pointed out the usage of git checkout branch features
, but I am not sure what is the point in that. As far as I understand it git checkout
just switches to a certain branch.
Can anyone point me in a correct direction as to how I might approach this. Again, I just need to get the latest changes of my remote master
branch so that when I push my features
branch I dont get a ton of conflicts.
features
withmaster
. Would it be wrong if i do this the other way around - mergemaster
intofeatures
. I am thinking of doing this, since when I create the pull request I want it to show that its from my features branch, not mymaster
branch. This is not really an issue, I am just curious. Again, thanks for the wonderful answer – Chatelain