Skip to content

Instantly share code, notes, and snippets.

@Stevie-O
Created November 24, 2014 18:14
Show Gist options
  • Save Stevie-O/e9d78c27c46974a2d342 to your computer and use it in GitHub Desktop.
Save Stevie-O/e9d78c27c46974a2d342 to your computer and use it in GitHub Desktop.
Strange rebasing issue
Commit sequence (chronological/commit order):
bedf5ed7be6407b75ce3eb8226663f4748192d06 [master]
4f4c68fa5df97cade596e5f64793a72062e045ba
Modify files T and W
b60ebdfcd23bd2c13f4202334507e840e960442a
Add file C, which should have been added in bedf5ed7be6407b75ce3eb8226663f4748192d06 (master)
028bfacebfbe0f9945c67635ac8f8b057743f6c6
Changes to several files, including file C
Several more commits after this
e05ab15ca6e4b10851b1a31ea02d849e6ff77322 [refactoring]
Tried to rebase like this:
git checkout refactoring
git rebase -i master
Swap the first two lines:
pick 4f4c68f Change "use default port" indicator from 0 to -1
pick b60ebdf Apparently C never got added; will need to use rebase to repair this
so it looks like this:
pick b60ebdf Apparently C never got added; will need to use rebase to repair this
exec cmd
pick 4f4c68f Change "use default port" indicator from 0 to -1
pick 028bfac Rework the way the client listen thread works
pick .... others
When I get to the 'cmd', it looks like after b60ebdf was replayed, the working copy wasn't cleaned up correctly:
D:\misc-wc\external\project>git status
rebase in progress; onto bedf5ed
You are currently editing a commit while rebasing branch 'refactoring' on 'bedf5ed'.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: src/C.c
no changes added to commit (use "git add" and/or "git commit -a")
Without the 'exec cmd', this causes the rebase to fail with this:
error: Your local changes to the following files would be overwritten by merge:
src/C.c
Please, commit your changes or stash them before you can merge.
Aborting
Could not apply 028bfacebfbe0f9945c67635ac8f8b057743f6c6... Rework the way the client listen thread works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment