If I am working on my branch, branch1
and then I push some commits while my team member was also working on branch1
--when it comes time for my team member to push his changes, he's now behind.
What is the easiest way for him to get my most recent commits, and attempt to merge his changes with mine? Let's assume he has already committed his changes before realizing this error.
I thought you'd do:
git pull origin/branch1 && git merge origin/branch1
but that doesn't seem to work at all.
I believe you'd do a rebase
, but I'm unsure of the process; all anyone talks about is doing rebase
with master
--but I don't want to do anything with master
at this point.
git pull
git pull
is actually an alias to those 2 commands:git fetch + git merge
so your second part of the command is useless.The way to grab changes is this - Several option:
OR:
rebase
If you want your changes to be on top of the other changes then you can use the
--rebase
flag when pulling the content.Image src: http://blogs.atlassian.com/
Stash + rebase automatically
You have those config which you can set:
rebase.autoStash
+pull.rebase