From the course: Git: Branches, Merges, and Remotes

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Push to an updated remote branch

Push to an updated remote branch

From the course: Git: Branches, Merges, and Remotes

Start my 1-month free trial

Push to an updated remote branch

- [Instructor] Let's examine what happens when we want to push some local changes up to a remote branch that has been updated by other people. So the scenario would look something like this. We have the remote server and it has three commits on it and we have the local repository on our computer, which also has three commits. Everything is in sync. So then I start work for the day and let's say I spend an hour putting together a commit and I commit it to my local repository. During the time that I was doing my work, my collaborators were also working and they already pushed up their changes to the remote server. Now if I go and try to push my changes to the remote server, it will fail and it's not failing because there's a conflict. It's not as if someone has made two changes to the same line and Git doesn't know how to sort it out. It's because there are new commits there and Git doesn't know what to do with our new commit. Our new commit presumably is supposed to go after f36de. So…

Contents