[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdt-dev] [egit-dev] Pull vs. Rebase
|
Pull using rebase only rebases your local commits, so this cannot cause problems.
Rebase can only cause problems if you later push a commit which is not a descendant of the upstream branch on the server (using push -f). I would recommend to reject these non-fast-forward pushes for production branches (master, CDT_X maintenance branches) on the server.
Even rebasing shared feature branches is totally safe if you communicate this before pushing such a rebased branch ("Please don't push in the next ... minutes because I am going to rebase the branch.", git pull, rebase, build+test, git push -f, "All green."). IMHO, this should even be a best-practice as it helps to keep the history linear (but I know that there are other opinions).
I am really sad that the git documentation makes such a big fuzz about rebase being a "dangerous" operation. IMHO, this causes a lot of FUD about a great feature and is not helpful at all.
Best,
Tobias
Am 12.05.2011 um 17:58 schrieb James Blackburn:
>
>
> On 12 May 2011 16:49, Schaefer, Doug <Doug.Schaefer@xxxxxxxxxxxxx> wrote:
> Could this be as a simple as not using Pull and using Fetch/Rebase instead?
>
>
> Fundamentally it requires committers to understand when they should do a Fetch+Merge(Pull) or a Fetch+Rebase. If they share a branch with others: on github or directly, then they should never rebase that branch (or they'll hurt downstream). Otherwise if they're formatting a commit for pushing into CDT they should rebase the patchset on top of the current branch's HEAD.
>
> In CVS they never had to make this distinction... Rebase can be dangerous, but the alternative of Pull + Push - which the UI leads you towards - will encourage sphagetti history. We've seen this here in a shared central repository with a team of users new to git and egit...
>
> Cheers,
> James
>
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
Ableton AG, Sitz Berlin, Amtsgericht Berlin-Charlottenburg, HRB 72838
Vorstand: Gerhard Behles, Jan Bohl, Bernd Roggendorf
Vorsitzender des Aufsichtsrats: Uwe Struck