Questions tagged [git-interactive-rebase]
65 questions
2
votes
4 answers
Is there any difference between git fixup and drop + reword while interactive rebasing?
I've started looking into interactive rebasing a little more and I've come across some issues. They are about the "fixup" option. I am interested in what is the difference between fixup and drop + reword option. For example, let's say we have:
pick…

Filip
- 401
- 8
2
votes
2 answers
Can I recover commits lost during interactive rebase?
So I have this weird situation.
I was doing an interactive rebase on 4 commits. I tried to squash, but I did it the wrong way around, I got the following error:
error: cannot 'squash' without a previous commit You can fix this with
'git rebase…

mal
- 3,022
- 5
- 32
- 62
2
votes
1 answer
Do I need to git rebase on every branch to fix a pathological commit message?
I was committing a large file to git, and it appears my editor messed up somehow when editing the commit message file. The result is the entire diff of ~100k lines became my "commit message". This is now slowing down the entire git server every time…

Wassinger
- 347
- 2
- 16
2
votes
1 answer
Editor automatically closes when running interactive rebase
I'm trying to squash 40+ commits together in a branch I'm working on using interactive rebase. My chosen editor in git is vscode. When I run the command:
git rebase -i
I briefly see the file to edit appear in vscode, but then it…

user-is-here
- 41
- 1
2
votes
2 answers
Remove/drop current commit within interactive rebase
I'm in an interactive rebase and have marked the commits on which I need to have a closer look with edit (e) now while looking into the commits I realize that some of the commits need to be dropped/removed. Which is the correct commit to do that…

white_gecko
- 4,808
- 4
- 55
- 76
2
votes
3 answers
What does COMMIT WILL BE LOST when rebasing in Git?
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup …

engineer-x
- 2,173
- 2
- 12
- 25
2
votes
2 answers
"git stash store requires one argument" during rebase --abort
Every time I think I'm a Git wizard some entirely new and weird thing happens to put me back in my place...
I was in the process of squashing two commits in an interactive rebase, when all of a sudden the outputs from Git started like overwriting…

Rabadash8820
- 2,328
- 3
- 27
- 49
2
votes
1 answer
Low Level Difference between git rebase, git rebase -i and git merge
During a rebase, where I synced my local feature branch to the upstream branch to finalize a pull request, I tried using all three methods (git rebase, git rebase -i and git merge) and each of them offered a completely different experience, when it…

TheCharlatan
- 288
- 3
- 17
2
votes
1 answer
Custom Git *Rebase* Commit Message Template
So, I know how to set a custom commit message template for git.
However, when I do an interactive rebase and use reword or squash, i would like to be able to set a custom message template for those commits as well.
So far, I haven't been able to…

Multifarious
- 216
- 1
- 5
2
votes
2 answers
What's the best way to use git to modify the history of master without affecting tags?
I'm writing an example application for a book.
Every important commit is tagged (e.g. Ch01_Ex04, Ch03_Ex01) so that readers can get straight to the state of the application that they're interested in.
Every now and then I change my mind about…

Seb Rose
- 3,628
- 18
- 29
2
votes
3 answers
How to rebase (squeeze) last commits to master and change commit message
In GitI have following situation:
o "ok" b6ca869 [my_branch*]
|
o "ok" 479d27c
|
o "ok" c80fad5
|
o "ok" 8f7fe87
|
o "master commit message" [master][remotes/origin/master]
I want to squeeze those 4 "ok" commits to and furthermore change the…

Marian Paździoch
- 8,813
- 10
- 58
- 103
2
votes
2 answers
git rebase -i shortcut -- finding the best commit to rebase on
Summary
What is the fastest way of finding, in the current branch, the most recent commit also contained in any other branches?
Bonus: Can the technique allow for "any other branches" in the question above to be "any other remote branches" or "any…

Meta
- 1,663
- 2
- 18
- 29
1
vote
1 answer
Bulk rename commit messages on git interactive rebase?
From this question, I know it is possible to prefix/modify all commits from a git-interactive-rebase.
But is it possible to modify all to-be-renamed commits messages in a single action? For instance when you select the reword command to just take…

Gonzalo Matheu
- 8,984
- 5
- 35
- 58
1
vote
1 answer
Interactive rebase: Git merges commits even if I don't want to
This problem is kinda difficult to describe without sharing the full repo, but I'll try.
I realized I had made a mistake in the last but one commit. I decided to fix it using interactive rebase.
git rebase -i @~~
Now I'm taken to Vim, where I…

peter.slizik
- 2,015
- 1
- 17
- 29
1
vote
1 answer
Git - How to squash the last commit with ANY other one
Consider the following series of commits on the local branch:
5 Correction of something meaningless, again !
4 Business correction n°3
3 Correction of something meaningless
2 Business correction n°2
1 Business correction n°1
I want to squash 5 with…

Flyout91
- 782
- 10
- 31