-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Rebasing Git for Windows
To do a rebase of the Git for Windows source onto a new upstream Git release, follow this guideline.
- You want to rebase onto a new upstream release tagged as
v2.3.4
- The latest rebase was done onto a upstream release tagged as
v2.3.3
- A working Git for Windows SDK.
- A fetched build-extra repository.
cd /usr/src/build-extra
git fetch
git checkout master
(git pull
if your branch is behind the upstream) - Working directory set to current Git for Windows source.
cd /usr/src/git
- Added upstream as a remote.
git remote add git https://github.com/git/git
git fetch git
- Find the commit of the last rebase and remember it.
BASE="$(git rev-parse ":/Start the merging-rebase")"
or possibly
BASE="$(git rev-parse HEAD^{"/Start the merging-rebase}")"
if there have been
trial merging rebases on other branches. Check with
git log -1 $BASE
andgit branch -a --contains $BASE
. - Run the
shears.sh
script to build up the actual rebase script.
../build-extra/./shears.sh --merging --onto v2.3.4 $BASE
Note:v2.3.4
is atag
in the remotegit
.
See the script if you are testing changes initiated in a local branch of the git upstream. - The rebase should start automatically and occasionally stop if it hits any merge conflicts. Resolve those conflicts and then continue the rebase.
git rebase --continue
-
Generate a diff of the previous state.
git diff v2.3.3..origin/master > prev.diff
-
Generate a diff of the current state.
git diff v2.3.4..master > curr.diff
-
Diff the diffs.
git diff --no-index prev.diff curr.diff
Ideally, the resulting output will show changes only in the
@@
lines ofprev.diff
vscurr.diff
.
It's a bit hard to read, though, because it is a diff of a diff.
So meta.
When there is a line that starts with a-
or a+
but then continues with a space, that's good!
It means that the context of our changes changed.
The newer git range-diff
may also be used.
This wiki page has been retired. All it did was to point to Git for Windows' governance model.