Current section: Commands 17 exercises

Syncing Remote Commits to Local Repository

The git pull command syncs remote commits back down to the local repository.

In our case, everything is up to date, so let's add a file remotely to demonstrate the process.

Adding a File via the GitHub Interface

GitHub provides a web interface to add files to a repository. Let's use it to ad

Loading lesson


00:00 Git pull is how we sync remote commits back down to our local repository. Right now everything is up to date so let's add a file remotely. Create file, name this git push.txt and give it the heading git push.

00:16 That's enough for our purposes so hit commit changes and change this to add push note. Finally commit. Now on our remote repository we have a commit that doesn't exist in our local repository. The commit that starts with da385e3. Let's run git pull again and see what happens.

00:35 Here we see the output for that command that resulted in adding this one file with the new commit. Now when we run git log locally we see that new commit and that head, main, and origin main are all in sync.