DEV Community

Sloan the DEV Moderator
Sloan the DEV Moderator

Posted on

Can Someone Explain Git Push and Git Pull?

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)

Collapse
 
tfrick47 profile image
Terri Fricker

git push to the main code, git pull from the main code

Collapse
 
tmchuynh profile image
Tina Huynh

Love this! It's so simple but SOOO useful especially for visual learners

Collapse
 
wjplatformer profile image
Wj • Edited

Just you know, using a picture to explain to Sloan. Totally my idea :)

Collapse
 
bobbyiliev profile image
Bobby Iliev

In addition to what has already been said, I could suggest this free ebook here on how I get started with Git and GitHub:

GitHub logo bobbyiliev / introduction-to-git-and-github-ebook

Free Introduction to Git and GitHub eBook

💡 Introduction to Git and GitHub

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.

🚀 Download

To download a copy of the eBook use one of the following links:

📘 Chapters

Collapse
 
tmchuynh profile image
Tina Huynh

Love this! It's such a great resource

Collapse
 
bobbyiliev profile image
Bobby Iliev

Thank you Tina! Really appreciate this! 🙌

Collapse
 
yuridevat profile image
Julia 👩🏻‍💻 GDE

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.

Collapse
 
pyrsmk profile image
Aurélien Delogu

git push is sending your modifications to the remote repository (like Github), while git pull is retrieving the modifications from the remote repository to your local project.

Nota bene : I voluntarily simplified things to have a simple explanation

Collapse
 
chrdek profile image
chrdek • Edited

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.

Collapse
 
srinubaburavilla profile image
Srinubabu Ravilla

git pull > Pull changes from remote branch
git push> Push commits to the remote branch

Collapse
 
polterguy profile image
Thomas Hansen

Pull; You buy me chocolate to be your friend.

Push; You throw vinegar at me to make me run to your neighbor

… 😉

Collapse
 
wjplatformer profile image
Wj • Edited

img