Learn how to pull changes from GitHub into your local repo and the different ways to do it in Visual Studio Code. Understand the right times to pull to ensure your work remains up-to-date and unconflicted.
Key Insights
- Pulling refers to the process of downloading changes made on the remote repository (GitHub) into your local repository.
- Once your local Git repo is aware of the remote repo, you can use the Pull command to download changes.
- You can pull changes by clicking the Synchronize Changes button at the bottom left of the Visual Studio Code window.
- Another way to pull changes is through the More Actions button at the top right of the Source Control panel in Visual Studio Code, and then selecting Pull from the menu.
- It's advisable to pull changes before you start working to ensure you have the latest updates.
- Pulling changes before you push is also recommended to handle any changes that might have occurred while you were working.
Learn about pulling changes from GitHub, including how to execute the pull command and when it's ideal to do so.
This exercise is excerpted from Noble Desktop’s Git & GitHub training materials and is compatible with updates through 2022. To continue learning web development with hands-on training, check out our coding bootcamps in NYC and live online.
Pulling (Downloading) Your Changes
After someone else makes changes to the remote repo (GitHub), you can download (pull) their changes into your local repo.
How to Pull Changes from GitHub
Once the local Git repo knows about the remote repo (GitHub), you can use the Pull command. Here are some different ways to do that:
At the bottom left of the Visual Studio Code window (in the blue bar), click the Synchronize Changes button
to pull and then push.
At the top right of Source Control panel
click the More Actions button
and from the menu choose Pull.
When to Pull
It’s a good idea to pull:
- Before you start to work (so you have the latest changes)
- Before you push (in case something has changed while you worked)