What's the difference between 'git pull' and 'git fetch'?
21–29 of 29 posts
Re: What's the difference between 'git pull' and 'git fetch'?
#22Re: What's the difference between 'git pull' and 'git fetch'?
#23Just read git-pull.sh: it's a 300-line shell script. How much simpler does it get?
Just because you understands the basics of Git doesn't mean you can understand the language it was written in.
Re: What's the difference between 'git pull' and 'git fetch'?
#24The real-world analogy is the probably apocryphal story about how some university/corporate campus/park whatever didn't put in paths, but instead waited a year to see where people walked and put in paths there. I first heard this story on John Siracusa's old podcast, but it's apparently been around for a long time. Some googling turned this up for yet another retelling: http://opensource.com/business/10/12/discovering-desire-line....
It's great because it really is insanely featureful compared to older VCS's, and it has absolutely enabled workflows that simply were not possible 10 years ago. On the other hand, the complexity and the inconsistencies and the TIMTOWTDIness of it all means that it is one more tool that you have to dedicate yourself to knowing inside out and thinking about all the time, as opposed to a tool that's more of a fire-and-forget thing that's easy to learn, easy to use, and never screws up (and doesn't give you enough rope to hang yourself).
Somewhere among git, Perl, Python, the Linux kernel, Mercurial, various Linux distros, various BSDs, and many many proprietary software projects, there is some really awesome classic book on software engineering waiting to be written, about the pros and cons of top-down vs. bottom-up design, having a BDFL vs. community-driven design and goals, user- vs. marketing- vs. developer-driven designs, etc.
Cathedral and the Bazaar doesn't count, it's way to shallow and opinionated about there being a right way to do everything. There really is no one true way to choose any of these approaches, and they all have their upsides and downsides. Maybe the best we can hope for is to be aware of these things and choose the best model on a per-project basis, and be able to adapt when that project's ideal model changes.
Re: What's the difference between 'git pull' and 'git fetch'?
#25Just read git-pull.sh: it's a 300-line shell script. How much simpler does it get?
It gets simpler by someone telling in short what's the difference so you don't have to read and understand the code. Just because you understands the basics of Git doesn't mean you can understand the language it was written in.
Read and ask questions about what you don't understand.
Re: What's the difference between 'git pull' and 'git fetch'?
#26Earlier quoted context omitted.
It gets simpler by someone telling in short what's the difference so you don't have to read and understand the code. Just because you understands the basics of Git doesn't mean you can understand the language it was written in.
Then being able to read basic code is a nice thing to aspire for, no? Read and ask questions about what you don't understand.
Re: What's the difference between 'git pull' and 'git fetch'?
#27 [ master ] -------------- [origin/master | master]
remote local
With this model in mind the difference is pretty clear. `git fetch` pulls down all the new stuff from origin and updates origin/master but leaves your local master untouched. You can then merge origin/master into your local master to bring it up to date. `git pull` just does both steps: pull down the remote data into origin/whatever, and then merge origin/whatever into whatever. master | origin/master | master
----------------->
git fetch
----------------->--------------->
git pullRe: What's the difference between 'git pull' and 'git fetch'?
#28Moreover, that analogy might approach illustrating the problem, but is still unsatisfying. Unlike, say, Eclipse, where one can readily sum up how Eclipse fails at being a well behaved GUI - it offers to do things that will fail and are nonsensical - git is, on the one hand, a lot better designed and it provides more value than Eclipse, and on the other hand git is even more baffling to beginners.
I want to see what's happening. I want to see what's going on at every accessible point in the workflow of every project I am working on. I want to see the results of actions. I want to be presented with all and only the sensible actions in ways that are discoverable. I do not want a lame fake "GUI" that is just dialogs pasted on a CLI.
Re: What's the difference between 'git pull' and 'git fetch'?
#29God says... prolonged shrunk cutting generally Justina evenly Jerusalem Husband succeed storing lethargy fruitful partners drank wrap forethought umm transgressors overspreading rightly tumultuousness officers infirmity exercised sink contentious usually blessest affection luxuriousness distractedly S unteach phrases outward 'Gainst four mock spent Lamentable now thraldom pride Finland begannest consecrateth unexplained anon boils issue blotted amazing unsung_hero