Zaonce...
loading...

This Planet is a Tedious Place...

23/06/16 Did that interactive git rebase work?

When I do a non-trivial interactive git rebase, I almost always want to check that there are no unexpected differences between my final commit and the original pre-rebase commit. I usually remember half way through the rebase to add a branch to the original commit, and add it using gitk, as it's handily displaying the pre-rebase history.

I've finally realised that I could make this much simpler with a hook, so I've added a local git hook (.git/hooks/pre-rebase) which contains the following:

#!/bin/sh
git branch before-rebase-`date "+%H%M%S"`


This will add the branch, named something like before-rebase-121451, for you automatically.

It will need manually removing afterwards, once you're happy, but makes it much easier to see where you were if you forgot before you started.

Once you've completed the rebase, you can just select the original commit (indicated by the branch) and compare the differences with the new head commit. It also means you can go back to the pre-rebase commit easily if the result is not what you intended.

posted by Gruntfuggly # 12:25 10 comments

[code]

Андрій Дячук # 14/02/17 07:06


[url][/url][*][/*][/center]yyoyoyoyo[center]

Somebody # 07/05/24 16:32


سكس sxs

Somebody # 02/05/17 21:41


[quote][/quote][code][/code][img][/img][url][/url][*][/*][center][/center][u][/u][i][/i]muioplasa del venemoda[b][/b]

Somebody # 19/08/18 20:53


Lamentável esse sit é fajuto pois não abre nenhum filme,

Somebody # 05/09/18 15:56


Facinating - there is a certain age group of like minded people that gravitate to the same subject matter. I came for motors and left with Elite. o7

Somebody # 26/05/20 16:17


[*]

Somebody # 10/10/20 16:50


">

Somebody # 23/11/20 05:14


[/*][img][/img][*][center][/center]

Somebody # 12/05/21 01:39


[/code][/img][url][/url][/*][*]

Somebody # 29/09/21 16:57



Somebody # 05/11/24 18:56

 

Add Comment