This is an anonymous post sent in by a member who does not want their name disclosed. Please be thoughtful with your responses, as these are usually tough posts to write. Email sloan@dev.to if you'd like to leave an anonymous comment or if you want to ask your own anonymous question.
Hey, I'm new to coding and I'd really love some help - can you please explain to me the difference between Git Push and Git Pull? Thank you.
Top comments (12)
Love this! It's so simple but SOOO useful especially for visual learners
Just you know, using a picture to explain to Sloan. Totally my idea :)
In addition to what has already been said, I could suggest this free ebook here on how I get started with Git and GitHub:
bobbyiliev / introduction-to-git-and-github-ebook
Free Introduction to Git and GitHub eBook
This is an open-source introduction to Git and GitHub guide that will help you learn the basics of version control and start using Git for your SysOps, DevOps, and Dev projects. No matter if you are a DevOps/SysOps engineer, developer, or just a Linux enthusiast, you can use Git to track your code changes and collaborate with other members of your team or open source maintainers.
The guide is suitable for anyone working as a developer, system administrator, or a DevOps engineer and wants to learn the basics of Git, GitHub and version control in general.
To download a copy of the eBook use one of the following links:
Dark mode
Light mode
Love this! It's such a great resource
Thank you Tina! Really appreciate this! 🙌
The difference between the two of them is, that when working on a project on your private computer (local) you can push your changes to the remote code (e.g. GitHub; it is now saved and possible to be shared like you can do with google drive or dropbox).
Now let's say, a friend of yours also wants to make some changes to that code you pushed to GitHub. They can do so by pulling the code from GitHub to their computer (local environment). After finishing, they push it again to GitHub and now, YOU can pull the changes to your computer as well.
This helps you working on the same piece of code with your friends and colleagues and always be up to date with the latest code.
git push
is sending your modifications to the remote repository (like Github), whilegit pull
is retrieving the modifications from the remote repository to your local project.Nota bene : I voluntarily simplified things to have a simple explanation
In brief: push -> send (push code to remote folder structure)
pull -> receive (fetch code from remote folder structure)
Note: this is of course combined with any diffing checks between local <-> remote folders contents/text.
git pull > Pull changes from remote branch
git push> Push commits to the remote branch
Pull; You buy me chocolate to be your friend.
Push; You throw vinegar at me to make me run to your neighbor
… 😉