<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Jarrod Spillers Blog - Latest Comments in git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.disqus.com/</link><description></description><atom:link href="https://jarrodspillers.disqus.com/git_merge_vs_git_rebase_avoiding_rebase_hell_jarrod_spillers/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 24 Jun 2013 23:34:49 -0000</lastBuildDate><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-941031455</link><description>&lt;p&gt;while i know what you meant, it doesn't make cttekin wrong. the argument is git gives you opportunities to shoot yourself in the foot while everyone runs around saying "blast away! shoot as many bullets as you want! git's got you." This, coupled with the shockingly bad advice gives you when encountering errors (first time i used it, all i was told to do was "git push" when I finished my code, i tried and it told me i had to say "git pull" before i could push... so blindly i listened and lost a whole days work XD ) makes it hard for me to blame noobs for certain mistakes... anyways THANK YOU SO MUCH FOR THIS ARTICLE&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">miguel</dc:creator><pubDate>Mon, 24 Jun 2013 23:34:49 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-858946077</link><description>&lt;p&gt;FWIW to be fair this wasn't git. Its the same as doing "rm -rf" on a directory in linux. You can blame Linux all you want but "With great power, comes great responsibility". Also due to the distributed nature of git the chances are very high someone else has those commits in their local repo.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nacengineer</dc:creator><pubDate>Wed, 10 Apr 2013 15:24:49 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-858770907</link><description>&lt;p&gt;Correct, the commits are still hanging around.  As long as you don't run a git garbage collect (git gc) then you should be able to recover any "lost commits" which aren't referenced within any branch and just hanging out in the ether...  Here's more about garbage collecting that provides a decent description in the comments.&lt;/p&gt;&lt;p&gt;&lt;a href="http://stackoverflow.com/questions/55729/how-often-should-you-use-git-gc" rel="nofollow noopener" target="_blank" title="http://stackoverflow.com/questions/55729/how-often-should-you-use-git-gc"&gt;http://stackoverflow.com/qu...&lt;/a&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sam Gleske</dc:creator><pubDate>Wed, 10 Apr 2013 12:13:39 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-841402597</link><description>&lt;p&gt;That explains many of my questions..thanks!!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">kavyak</dc:creator><pubDate>Mon, 25 Mar 2013 02:56:47 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-829196366</link><description>&lt;p&gt;The visual style of this post is great. Thanks for taking time to do that. Often git related posts are missing this, and are confusing to follow.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Steven J. Dale</dc:creator><pubDate>Thu, 14 Mar 2013 11:03:30 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-815868028</link><description>&lt;p&gt;We have also lost commits because we were all sharing the master branch.  It is always hard to transition from one methodology to another, and sometimes any excuse will do.  Hence the very vocal fear I am sure.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">David Tanner</dc:creator><pubDate>Thu, 28 Feb 2013 17:56:10 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-799203251</link><description>&lt;p&gt;I agree with Cttekin.  While courage is paramount to using Git, you can easily get confused and not know what git commands to execute next when you rebase another developer's branch.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Igor Ganapolsky</dc:creator><pubDate>Thu, 14 Feb 2013 11:25:06 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-799076504</link><description>&lt;p&gt;Minor nit:  "pull –rebase" should be "pull --rebase".  That is, two normal dashes, not one extra-wide "em" dash.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Asymptote</dc:creator><pubDate>Thu, 14 Feb 2013 09:16:32 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-797578975</link><description>&lt;p&gt;had enuf of tutorials/theories...time to do it in real...&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ashish Sajwan</dc:creator><pubDate>Wed, 13 Feb 2013 07:38:00 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-785363151</link><description>&lt;p&gt;Actually we did lose commits because of rebase, because of the exact reasons author describes. &lt;br&gt;When a shared branch is rebased and pushed, other people working on the same branch get orphaned. They try to push their changes, and git doesn't let them and says "their branch is diverged" - At this point, most new developers don't understand what this means, and just force push their local changes - this push actually is the evil and makes the changes get lost...&lt;br&gt;Follow the author's last advice - never rebase a shared branch. &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Cttekin</dc:creator><pubDate>Thu, 31 Jan 2013 22:40:04 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-726297464</link><description>&lt;p&gt;Thanks, this is exactly the explanation I needed.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Guest</dc:creator><pubDate>Mon, 03 Dec 2012 14:33:46 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-716280699</link><description>&lt;p&gt;I'm just trying to understand the way git works, how to use it and – especially – why. If often read "Don’t rebase branches you have shared with another developer." I'm probably not getting it right, but I hope you can help me with this.&lt;/p&gt;&lt;p&gt;The master branch is shared with other developers, of course. Since I shouldn't rebase branches I have shared with other developers, I should never use rebase on master branch, right?&lt;/p&gt;&lt;p&gt;Well, I know it's not right. You even showed an example, that explains rebasing on the master branch. But I'm confused. 'Only non-shared branches' seems to be wrong criteria for using rebase, since the master is shared.&lt;/p&gt;&lt;p&gt;Where does my thinking go wrong?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Enno</dc:creator><pubDate>Wed, 21 Nov 2012 17:26:46 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-708896597</link><description>&lt;p&gt; Both are helpful for me.&lt;br&gt;From the post, I know where I'm lost.&lt;br&gt;From Eric's comment, I know my way back.&lt;br&gt;Thank you.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Qun</dc:creator><pubDate>Tue, 13 Nov 2012 04:20:13 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-703052739</link><description>&lt;p&gt;A little misleading... rebase doesn't uncommit anything, all your original commits are still there if you want to go back.  Rebase just creates brand-new commits that emulate what you did in the old commits, only this time starting from the newly updated base. &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ak</dc:creator><pubDate>Wed, 07 Nov 2012 13:43:54 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-659658587</link><description>&lt;p&gt;I'd write up MY own tutorial, but I don't think I could do as good a job, so I'll settle for criticizing yours... :)&lt;/p&gt;&lt;p&gt;Seriously, though, nice post, but buried in Eric's criticism is a useful point for teaching Git.&lt;/p&gt;&lt;p&gt;Courage.&lt;/p&gt;&lt;p&gt;It's possible to get yourself pretty confused with Git at first. But it is *really* hard to lose anything. Rebasing won't do it. Git generally remembers anything it has ever seen, whether it's part of the current history or not. If you did 'git add &lt;a href="http://MyNewWonder.java" rel="nofollow noopener" target="_blank" title="MyNewWonder.java"&gt;MyNewWonder.java&lt;/a&gt;' on a first draft, never committed, then blew it away -- Git remembers. Git will remember in that case for 30 days -- and yes, I've recovered files that way.&lt;/p&gt;&lt;p&gt;Screw up a rebase? Do git reflog, find a state you like,  and do 'git reset --hard &amp;lt;sha&amp;gt;' and you're teleported right back.&lt;/p&gt;&lt;p&gt;With Subversion, ClearCase, and the like, you're making a record of every stumble you make -- or else you're only capturing what you want others to see.&lt;/p&gt;&lt;p&gt;With  Git, you capture anything and everything -- and then you organize it to tell a clear and accurate story, and push that.&lt;/p&gt;&lt;p&gt;The result is the difference between a log and a novel. Yet you've got all those notes and drafts saved away that you'd never dare commit to SVN.&lt;/p&gt;&lt;p&gt;With Git, you can play around with new characters, and even reorder the plot, all in the safety of your own garret, until it's time to send it off to the publisher.You don't dare do that sort of thing with SVN. It's not your post that scared Eric's coworkers. Not really. It's their experience with SVN, and I think we're doing new users a favor by encouraging them to experiment freely.I wish I'd had that advice when I'd started out.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bob Kerns</dc:creator><pubDate>Sun, 23 Sep 2012 02:54:32 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-639239433</link><description>&lt;p&gt;Hi, Could you please explain this a bit more "Also, the picture is wrong.  In the "after" picture, the red and blue commit should be side by side above the black commit, and the green commit should be above them.  The black commit is, both before and after, the parent of the red and blue and the green commit is the child of the red and blue.&lt;/p&gt;&lt;p&gt;Thanks&lt;br&gt;"&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kev</dc:creator><pubDate>Tue, 04 Sep 2012 05:32:07 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-638733376</link><description>&lt;p&gt;Finally an article which suggests what to use when. Xcellent xplanation.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Kev</dc:creator><pubDate>Mon, 03 Sep 2012 13:43:01 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-618059324</link><description>&lt;p&gt;In the amount of time you just spent criticizing my post you could have written up a wonderfully thoughtful tutorial of your own. Sorry for scaring your developers... hopefully they are not still hiding under their cubicles. &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jrod</dc:creator><pubDate>Mon, 13 Aug 2012 10:33:46 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-617998540</link><description>&lt;p&gt;This article unnecessarily scared some of the developers at our organization who are transitioning from subversion.&lt;/p&gt;&lt;p&gt;From what I have seen, once developers become accustomed to Git, Git eliminates fear.  I commit (locally) much more frequently since there is no risk; I understand what I'm pushing remotely before I do so; I can rebase or merge remote changes according to the need; I can easily share commits with other developers for peer review, etc. &lt;/p&gt;&lt;p&gt;From reading your article it makes it sound like the commits are at risk of being lost when using rebase, like as if something goes wrong such as your computer crashing or a merge conflict goes awry that the commits could be lost.  That is not the case.  git preserve the branch you were on until the rebase successfully completes.  In the meantime you can always do a "git rebase --abort" to undo the rebase.  After it commits, you can use git reflog to see all of the commits that were supposedly "lost" or "uncommitted" from any recent rebase (since the last garbage collection which for me is less than once a month).  You can easily create a branch for any of those commits using "git branch foo &amp;lt;sha1&amp;gt;" and look at it, switch to it, etc.  I have NEVER lost a single commit doing a rebase after over 2 years of using git heavily.  When there are no conflicts (usually the case) then everything happens totally smoothly.  When there is a conflict, either I easily resolve it or else I "git rebase --abort" and react to the kind of conflict I got such as reordering or squashing the commits using (git rebase --interactive).  If several of my commits conflict, I may use "git merge" so that I only have to resolve conflicts once, in which case the noise in the history is worth it.&lt;/p&gt;&lt;p&gt;I don't think that it was clear to git newbies that the only time you're recommending not using git rebase is to rebase onto someone else's commit that has not been pushed to origin.  In our organization, that is such a corner case that it hasn't even come up in the last year for me.  The only reason I can see to do this is if I am really confident that the commits will be pushed to origin/master soon.  When they are not my commits, it's much more likely that the author will push them there before I gain such confidence.  The very fact that he hasn't pushed them to origin/master implies that he isn't confident, so why should I be?  Even if I thought his changes were sound, he could still squash other changes into those commits for tidiness or other reasons at which point I'd have to rebase onto those new commits before I could push.  Actually, unless he gave me permission to push his changes, I couldn't push to origin/master at all until he pushed his.  Since I hate waiting, I'm VERY unlikely to do that.  I'd just assume work on something else that doesn't cause me to be blocked by another developer.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eric Pabst</dc:creator><pubDate>Mon, 13 Aug 2012 08:49:42 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-499081880</link><description>&lt;p&gt;very well explained! Thank you!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eun Woo Song</dc:creator><pubDate>Mon, 16 Apr 2012 14:22:25 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-455310619</link><description>&lt;p&gt;excellent explanation for those coming from other systems. &lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anthony Your</dc:creator><pubDate>Sat, 03 Mar 2012 09:07:09 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-375332553</link><description>&lt;p&gt;Also, the picture is wrong.  In the "after" picture, the red and blue commit should be side by side above the black commit, and the green commit should be above them.  The black commit is, both before and after, the parent of the red and blue and the green commit is the child of the red and blue.&lt;/p&gt;&lt;p&gt;"empty" is sloppy terminology anyway, because commits don't contain things - they kind of look like what are patches in other code control systems, but a Git commit is just metadata.  The merge commit may be "empty" in the sense that the files you modified may exhibit no difference (git diff) between the red and green code levels.&lt;br&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Bryan Henderson</dc:creator><pubDate>Tue, 29 Nov 2011 18:17:52 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-306791693</link><description>&lt;p&gt;Thanks, as far as I understand you should never rebase a branch shared with another person, because initial commits disappear and get replaced with brand new ones. Then it becomes a hell to merge with the person that has pulled from that branch because he will have your disappeared commits and git will look at them as new ones although they have been actually superseded. Correct?&lt;/p&gt;&lt;p&gt;P.S. as far as I'm reading, general recommendation is to follow established workflows and NOT EVER TRY TO BE SMART if you are not :)&lt;/p&gt;&lt;p&gt;[1] Disclaimer: I'm learning git today&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Aleksandar Kostadinov</dc:creator><pubDate>Sat, 10 Sep 2011 15:29:57 -0000</pubDate></item><item><title>Re: git merge vs git rebase: Avoiding Rebase Hell - Jarrod Spillers</title><link>http://jarrodspillers.com/2009/08/19/git-merge-vs-git-rebase-avoiding-rebase-hell#comment-186356682</link><description>&lt;p&gt;They're not empty commits, the merge commit have both codes merged&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jvlppm</dc:creator><pubDate>Sun, 17 Apr 2011 17:06:16 -0000</pubDate></item></channel></rss>