Questions tagged [git-interactive-rebase]
65 questions
5
votes
0 answers
Can the merge strategy for a Git Interactive Rebase be changed while the rebase is paused?
I am trying to squash all of the commits from my master repo down to one commit within my branch. I am doing this because the master branch is pulled from a remote repo that we don't control whereas the branch in question is pulled/pushed to our own…
user1618236
4
votes
1 answer
What happens to the original commits when we use interactive rebase?
I am trying the interactive rebase. Assuming I have a linear master branch with 6 commits and the HEAD is on the 6th commit, and I run git rebase -i HEAD~4 then it allows me to pick/edit/split/squash the HEAD and the last 3 commits.
Once I do any of…

variable
- 8,262
- 9
- 95
- 215
4
votes
2 answers
git interactive rebase: stop without commit
(TLDR)
Is there a way in git rebase -i to stop for editing, without a commit id?
(/TLDR)
Longer version:
Background
With git rebase -i, I get a text editor where I can define a list of commands, starting with pick COMMIT_ID on each line.
One of the…

donquixote
- 4,877
- 3
- 31
- 54
4
votes
1 answer
Silence git rebase --interactive's "how to proceed" message
I've written a script to automate a git rebase --interactive to edit a specified commit using GIT_SEQUENCE_EDITOR=sed ...s/pick/edit/...
How do I prevent the "helpful" message that git rebase --interactive prints out:
Stopped at 307c446... Add…

Tom Hale
- 40,825
- 36
- 187
- 242
4
votes
1 answer
How can I insert line breaks to reworded commit messages during git interactive rebase?
I want to insert line breaks in the middle of commit messages while rewording them in interactive rebase. How can I achieve this?
I'm using Notepad++ as the external editor for interactive rebase.

starikcetin
- 1,391
- 1
- 16
- 24
4
votes
1 answer
git: automatic line-specific fixup
I recently learned about git commit --fixup which marks your commit as fixup of an earlier commit and automatically arranges them next to each other during an interactive rebase.
How can I do that automatically and separately for multiple…

PhilLab
- 4,777
- 1
- 25
- 77
4
votes
1 answer
smartgit rebasing origin/local onto local / or in the opposite direction
When I use pull and rebase local change or just fetch origin branch and then manually rebase local head via "rebase HEAD To" to origin/local branch... I can get merging conflicts, but it's ok.
Only two things are disturbed me:
first, the head…

Ark
- 1,343
- 2
- 12
- 26
3
votes
1 answer
Git interactive rebase HEAD not point at last commit
I just ran an interactive rebase using the following commands:
git checkout editing
git rebase -i main
# do interactive rebasing, specificically squashing
git checkout main
At this point I expected all the (squashed) commits to be copied/replayed…

Max888
- 3,089
- 24
- 55
3
votes
1 answer
Rebase "fixup" commit into prior merge commit
I have performed the following merge:
A---B---C---E (HEAD, merge of C and D)
/
D---|
But I noticed some issues in E, and fixed them in F:
A---B---C---E---F (HEAD)
/
D---|
I want to modify commit E so that it…

Craig Otis
- 31,257
- 32
- 136
- 234
3
votes
1 answer
Is there a way to simply prepend a commit with interactive rebase?
Lets say I have a branch based on master which ends with merge commit:
--A---C

amik
- 5,613
- 3
- 37
- 62
3
votes
1 answer
Why is an interactive rebase squishing my commits together?
Let's say that I have the following three commits:
c - Third Commit
b - Second Commit
a - First Commit
I use the following commands to perform the interactive rebase (as described in another StackOverflow thread)
$ git rebase --interactive…

Pete
- 7,289
- 10
- 39
- 63
3
votes
1 answer
How to see the content of a commit when rewording its message using 'git rebase'?
I'm fixing some commit messages of a series of commits. I start
git rebase --interactive
mark some commits for rewording and then edit the messages. It'd be really helpful if I could see the diff of each commit in the editor, just like when doing…

Petr
- 62,528
- 13
- 153
- 317
3
votes
2 answers
git rebase --interactive (reword) left me with two trees with same commit messages
I wanted to reword my commit messages. I used git rebase --interactive, and used reword to alter commit messages. My expectations were that my tree will remain exactly the same, but with different commit messages. Instead, I ended up with 2…

Dennis
- 7,907
- 11
- 65
- 115
3
votes
2 answers
How do I automatically determine the best commit to interactively rebase from?
I frequently use "fixup!", "squash!" and "rebase -i" to clean up, correct, or just fiddle with recent, unpushed history. I'd like to find a way to get Git to automatically choose which commit makes the most sense for interactive rebasing, so that I…

Parker Coates
- 8,520
- 3
- 31
- 37
2
votes
2 answers
Squashing multiple commits that contain merge with main commits
Suppose we have the following scenario:
main branch
feature branch for new improvements
In the feature branch the commit history looks like this (main branch updates during the development process of feature branch and we want to keep feature…

Stefan Ss
- 45
- 5