Skip to content

kiprasmel/git-rebase-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

git-rebase-diff
===============

a tiny wrapper around git range-diff,
to make it easy to use after performing a rebase
(or multiple rebases, as long as you haven't pushed to a remote branch yet).

esp useful if encountered merge conflicts
& want to verify that nothing screwed up.
see also: https://github.com/kiprasmel/git-diff3c


setup
-----

```
git clone https://github.com/kiprasmel/git-rebase-diff.git
# or:  git clone git@github.com:kiprasmel/git-rebase-diff.git

cd git-rebase-diff
cp git-rebase-diff /usr/local/bin/

# optional alias
git config --global alias.rd rebase-diff
```


usage
-----

expects that you:
- are checked out in the branch you rebased
	- the branch has a remote counterpart

```
git-rebase-diff
git-rebase-diff [options]...
git-rebase-diff -- [range-diff args]...
```


behavior
--------

essentially does:

```
old=@{u}
new=@
base=$(git merge-base $old $new)
git range-diff $base..$old $base..$new
```


viewing a previous rebase diff
------------------------------

git-rebase-diff --prev 0   # current (no effect)
git-rebase-diff --prev 1   # 1st previous
git-rebase-diff       -1   # 1st previous
git-rebase-diff       -5   # 5th previous
git-rebase-diff       -max # very last


viewing an interval of grouped rebase-diffs
viewing multiple rebase-diffs
---------------------------------------

git-rebase-diff --left 5           # from previous 5th till current
git-rebase-diff --left 5 --right 2 # from previous 5th till previous 2nd


known issues
------------

won't work if you rebased starting from the initial commit (via --root)


see also
--------

- man git-range-diff
- https://stackoverflow.com/a/61219652/9285308
- https://github.com/kiprasmel/git-diff3c

About

git range-diff, but works automatically after a rebase.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages