From the course: Programming Foundations: Version Control with Git

Unlock the full course today

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

Keep repositories up to date with Git pull and push

Keep repositories up to date with Git pull and push

From the course: Programming Foundations: Version Control with Git

Start my 1-month free trial

Keep repositories up to date with Git pull and push

- When using a local and remote repository, there are a couple of extra steps required in the Git Workflow to make sure everything stays synced and up to date. Git push is used to upload the local commits into the remote repository, and git pull is used to download the commits from the remote repository into the local repository. Let's look at the status message from the last exercise after adding the local commit. On branch master refers to the local and default master branch. This is where we are currently. It also tells us the name of the remote branch, origin/master. Origin refers to the remote repo, which is also using its master branch. So, our local master branch has one newer commit than the remote master branch, making it ahead by one commit. The status message also tells us how to sync them. Git push to publish your local commits. To specify where to push the commits, use the git push command with the…

Contents