VOOZH about

URL: https://www.javacodegeeks.com/2018/09/git-pull-git-fetch.html

⇱ What is the difference between 'git pull' and 'git fetch'? - Java Code Geeks


In the simplest terms, git pull does a git fetch followed by a git merge.

You can do a git fetch at any time to update your remote-tracking branches under refs/remotes/<remote>/.

This operation never changes any of your own local branches under refs/heads, and is safe to do without changing your working copy.

I have even heard of people running git fetch periodically in a cron job in the background (although I wouldn’t recommend doing this).

A git pull is what you would do to bring a local branch up-to-date with its remote version, while also updating your other remote-tracking branches.

git pull = git fetch + git merge.

Published on Java Code Geeks with permission by Ahmad Gohar, partner at our JCG program. See the original article here: What is the difference between ‘git pull’ and ‘git fetch’?

Opinions expressed by Java Code Geeks contributors are their own.

Do you want to know how to develop your skillset to become a Java Rockstar?
Subscribe to our newsletter to start Rocking right now!
To get you started we give you our best selling eBooks for FREE!
1. JPA Mini Book
2. JVM Troubleshooting Guide
3. JUnit Tutorial for Unit Testing
4. Java Annotations Tutorial
5. Java Interview Questions
6. Spring Interview Questions
7. Android UI Design
and many more ....
I agree to the Terms and Privacy Policy

Thank you!

We will contact you soon.

Tags
Git
👁 Photo of Ahmad Gohar
Ahmad Gohar
September 7th, 2018Last Updated: September 7th, 2018
1 168 1 minute read

Ahmad Gohar

Technical Team Leader with 9+ years experience in designing and developing enterprise Solution using Oracle, IBM, and Open Source. With a solid technical and academic background. Strong technical project management experience, coordinate demo's for QA team, performing code, design and test plan reviews.
Subscribe

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
Oldest
Newest Most Voted
7 years ago

good article, bad ads

25
Reply
Back to top button
Close
wpDiscuz