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
From the course: Programming Foundations: Version Control with Git
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
-
-
-
-
Using the command line1m 17s
-
Command line basics4m 15s
-
Configure Git settings3m 11s
-
Setting up a local repository3m 1s
-
Setting up a remote repository3m 43s
-
Adding changes with Git add and commit4m 50s
-
Keep repositories up to date with Git pull and push3m 34s
-
Deleting a repository or branch29s
-
Challenge: Putting it all together1m 31s
-
Solution: Putting it all together5m 39s
-
-
-