TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Why is git pull considered harmful? (2013)

233 pointsby aleemabout 11 years ago

24 comments

sergiosgcabout 11 years ago
I feel tempted to just answer the question using the Betteridge Law of Headlines: Why is git pull considered harmful? It isn&#x27;t.<p>- nonlinearities aren&#x27;t intrinsically bad. If they represent the actual history they are ok.<p>- accidental reintroduction of commits <i>rebased</i> upstream are the result of wrongly rewriting history upstream. You can&#x27;t rewrite history when history is replicated along several repos.<p>- modifying the working directory is an expected result; of debatable usefulness, namely in the face of the behaviour of hg&#x2F;monotone&#x2F;darcs&#x2F;other_dvcs_predating_git, but again not intrinsically bad.<p>- pausing to review others&#x27; work is needed for a merge, again an expected behaviour on git pull<p>- making it hard to rebase against a remote branch is good. Don&#x27;t rewrite history unless you absolutely need to. I can&#x27;t for the life of me understand this pursuit of a (fake) linear history<p>- Not cleaning up branches is good. Each repo knows what it wants to hold. Git has no notion of master-slave relationships.
评论 #7386370 未加载
评论 #7387534 未加载
评论 #7386149 未加载
评论 #7387180 未加载
评论 #7388306 未加载
评论 #7385924 未加载
bclabout 11 years ago
If git pull is causing problems for you, you are not using git correctly. You shouldn&#x27;t be doing work on upstream branches -- that&#x27;s one of the wonderful things about git, branching is cheap.<p>When working with more than 0 other people you should reserve the upstream branches for merging <i>your</i> work and pushing. Do your actual work in a branch and you can easily commit&#x2F;stash our working tree, switch to the other branch and examine their changes.
评论 #7385712 未加载
评论 #7385847 未加载
评论 #7385674 未加载
评论 #7385514 未加载
评论 #7385736 未加载
评论 #7385460 未加载
googletronabout 11 years ago
The although the answer is quite thorough in almost every example you had to be doing something else incorrectly for git pull to be an issue.<p>I have often railed with other developers working on mid&#x2F;large sized projects about having this pristine git history where commits are all tailed back to back. My main issue with this is the fact that you never get a commit for when two branches come together so you never really know when an issue was introduced.<p>i.e.<p>Branch A works. Branch B work.<p>Branch A-B doesn&#x27;t work. No merge commit to show introduction of bug.<p>People in general practice should not be force pushing.<p>Most of the arguments seem to be against not know what you are going to get which can be preempted with a fetch portion of git pull, but if you don&#x27;t trust people you are working with, work with new people.<p>git pull doesn&#x27;t delete old branch just as git add doesn&#x27;t to delete old branches, I am not even sure making an argument like that means, its not what git pull is for.
tristan_juricekabout 11 years ago
This sort of &quot;git pull&quot; slam is really just an aftershock of shooting yourself in the foot.<p>The UX of git is so different from other tools, but seems so similar. It&#x27;s a real problem for newbies. It&#x27;s easy to think you know what&#x27;s going on, because is vaguely similar to other operations. And, for the impatient, the documentation is really, really obnoxious. And most developers I&#x27;ve met are fairly impatient.<p>End result: most developers I&#x27;ve met has shot themselves in the foot when they started to use git.<p>When I bring people onto git now, I start them with a nice visual tool in an existing repo; my current favorite is SourceTree. But that&#x27;s not a requirement. The simple fact that they can a nice history log with see tags of &quot;origin&#x2F;master&quot; and &quot;master&quot; usually triggers that &quot;WTF&quot; experience and they start asking the right questions. If I start them with a new repo, and then have them add, and stage, it&#x27;s all a bunch of things they could figure out, and they get impatient, and then bad things happen when it comes time to play with others.
jordighabout 11 years ago
Meanwhile, &quot;hg pull&quot; is just fine (it really works more like git fetch).<p>This really is just another case of bad UI design in git.
评论 #7386142 未加载
Jacenabout 11 years ago
Why was this link put into hacker news ? It&#x27;s old, it is also based on inaccurate understanding of git. Experienced git users don&#x27;t need this(1). Is Hacker news designed to publish hints for beginners ?<p>Hacker news aimed at links that are deeply interesting.<p>&gt; &quot;A crap link is one that&#x27;s only superficially interesting. Stories on HN don&#x27;t have to be about hacking, because good hackers aren&#x27;t only interested in hacking, but they do have to be deeply interesting.&quot;<p>In my opinion, this link is superficial, and does not go in the real topic : the workflow.<p>(1) In my opinion, an experienced git user should know what he need to fetch, and when he should have a merge instead of rebasing some commits, and should also know the commands to do so. It&#x27;s more a matter of workflow than a matter of git command.
评论 #7385715 未加载
评论 #7386016 未加载
websitescenesabout 11 years ago
I have never had an issue with git pull. With proper communication and push&#x2F;pull etiquette, there will rarely be conflicts and when there are, just rebase. I don&#x27;t think it is ever ok to force a push. If you are having trouble reviewing others commits then try using gitx to view the changes in an easy to read way. I like that it doesn&#x27;t remove deleted branches because sometimes I still want it when the rest of the team doesn&#x27;t. I&#x27;m not convinced..
mcfunleyabout 11 years ago
So I take it that the poster is also the one who gets worked up when people use git pull? This person is criminally insane and I feel for his colleagues.
anton_gogolevabout 11 years ago
It&#x27;s not harmful. It&#x27;s just the surprising asymmetry between &quot;git pull&quot; and &quot;git push&quot;: for some reason (which is obvious), &quot;git push&quot; does _not_ merge, whereas &quot;git pull&quot; does.<p>Again, compare with how perfectly symmetrical pull&#x2F;push operations are in Mercurial.
评论 #7388470 未加载
SeanDavabout 11 years ago
Although SO does give one the option to answer an own question it is clear here that this guy posted his question in order to answer it, perhaps to farm points, perhaps because he thought his answer is genuinely useful. The answer is time stamped the same as the question.<p>Not sure why we should care one way or the other but to me it does seem a bit against the spirit of how SO should be used.
评论 #7385451 未加载
评论 #7385476 未加载
评论 #7385669 未加载
评论 #7385607 未加载
评论 #7386069 未加载
评论 #7387059 未加载
评论 #7385455 未加载
评论 #7385452 未加载
badman_tingabout 11 years ago
Oh cripes. I just want to do my work and commit my code.
评论 #7386277 未加载
评论 #7386135 未加载
评论 #7386216 未加载
zwiebackabout 11 years ago
Seems obvious to me that git is just the tool we use to implement a specific workflow. If the developers don&#x27;t understand or disagree about the workflow it will be a bumpy road. git pull is certainly part of our workflow but doesn&#x27;t generate much pain at all.
bsg75about 11 years ago
The accepted answer on SO is to create an alias of a command sequence, including a git config for the command session.<p>It is really a git best practice to create custom commands for common operations?
评论 #7385960 未加载
评论 #7386359 未加载
merloenabout 11 years ago
I have a cronjob that does a &quot;git fetch&quot; every 5 minutes. That means I never pull. I merge-fastforward, and I rebase. Very satisfied with that workflow.
joshlegsabout 11 years ago
That post really irks me. Granted, S.O. encourages you to answer your own question, but this guy would have been much better served by a blog post. A Q&amp;A is not the appropriate format for him to ask a question when he has no need for an answer. Seriously, blog it, dude.
richardjordanabout 11 years ago
Ah. So THIS is how you juice your stack overflow ranking. Good to know.
评论 #7386275 未加载
评论 #7386307 未加载
Guvanteabout 11 years ago
Apparently a solution has been released for git 2.0.<p>&gt; &quot;git pull&quot; can be told to only accept fast-forward by setting the &gt; new &quot;pull.ff&quot; configuration.
nikonabout 11 years ago
git pull --rebase
评论 #7385443 未加载
jherikoabout 11 years ago
isn&#x27;t this just another very special case of &#x27;modifying history is harmful&#x27;?
mokkolabout 11 years ago
I use git-up for this issue. <a href="https://github.com/aanand/git-up" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;aanand&#x2F;git-up</a>
njharmanabout 11 years ago
Why is git so god damn hard &#x2F; complicated? I mean other than haven been created by and for Kernel Developers.
unethical_banabout 11 years ago
Another example of how complex git can be. How I wish git&#x27;s interactions were more like bzr!
evanmabout 11 years ago
w&#x2F;e. i &lt;3 git pull
a3voicesabout 11 years ago
It&#x27;s amusing how the same person posted and answered the question. It&#x27;s almost like he&#x27;s using Stack Overflow as a blog.
评论 #7385382 未加载
评论 #7385403 未加载
评论 #7385592 未加载
评论 #7385365 未加载
评论 #7385421 未加载
评论 #7385493 未加载
评论 #7385372 未加载