Questions tagged [git-interactive-rebase]

65 questions
1
vote
1 answer

How to work in Git interactive mode - unable to work with the text editor?

EDIT: It turned out that it was the editor VIM that is hard to use and not the commands. I am posting a link to, how to exit out of VIM editor for everybody's reference: How do I exit the Vim editor? I know this is a pretty newbie question but…
Manish Kumar Sharma
  • 12,982
  • 9
  • 58
  • 105
1
vote
3 answers

git still in status rebasing after reset to ORIG_HEAD

I got myself into trouble with an interactive rebase: Since I could not abort the interactive rebase via git rebase -i --abort I tried to git reset --hard ORIG_HEAD However, when I run git status, I now get On branch feature1 You are currently…
Albert
  • 85
  • 6
1
vote
0 answers

Recover commit list after undoing an interactive rebase in git?

My situation: There are two remotes, origin and fork (the latter is owned by me). I checked out origin/devel, changed some code and committed like 5x to my local branch test. I pushed my commits to fork/test. Then I started an interactive rebase,…
CodeManX
  • 11,159
  • 5
  • 49
  • 70
1
vote
3 answers

Combining non-linear commits into one commit (sausage making)

Consider the following git history: * 21f05f9 - Fifth commit * 0534049 - Fourth commit * 738ae0a - Third commit * 288ffd2 - Second commit * 2535dca - First commit How would I combine 21f05f9 738ae0a and 2535dca into one commit? I have tried git…
Fillip Peyton
  • 3,637
  • 2
  • 32
  • 60
1
vote
3 answers

Why does my git interactive rebase change for the last commit message then show Everything up-to-date when I do a push?

I did a push of my latest changes git push origin master then I amended the commit message with an interactive rebase, i.e. git rebase -i HEAD~5 and changed the message in the last commit. This saved successfully, but when I did a git push origin…
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
1
vote
3 answers

How to rebase commits of the same branch in Git?

I did some wrong rebasing and conflict resolution in Git, so I ended up in this stupid situation: * 8379515 (HEAD, origin/master, origin/HEAD, master) Merge branch 'binary-mobile' |\ | * 21b247a (binary-mobile) Add Binary Mobile | * c66dced Add…
Alexander Popov
  • 23,073
  • 19
  • 91
  • 130
1
vote
2 answers

Interactive rebase on commit after branching off

I have the following (simplified) scenario in my git repository: A-B-C-F \ D-E Commit F is a fix for C and this needs to become a single commit. I tried an interactive rebase on the "main" branch using git rebase -i HEAD~2, but this…
Roger Rapid
  • 956
  • 1
  • 8
  • 28
0
votes
1 answer

Best way to sign (-S) each commit during an interactive rebase?

If you are doing an interactive rebase (eg: git rebase -i HEAD~3) and you modify n-2 [aaaa]: e aaaa commit message for n-2 pick bbbb commit message for n-1 pick cccc commit message for n After you are done editing (git commit -S --amend), even if…
Nathaniel
  • 83
  • 1
  • 7
0
votes
2 answers

What's the default value for Git `rebase.instructionFormat` config variable?

Git 2.6 added the rebase.instructionFormat config variable for configuring the format of the interactive rebase instruction lines. As per the documentation, the different formatting options one can choose come from git log. But the documentation…
ruohola
  • 21,987
  • 6
  • 62
  • 97
0
votes
0 answers

Amending a commit further down the stack and propagation of changes up the stack

I have a stack of git commits from oldest to newest: com1 com2 com3 I want to modify something in com1 and have to propagate to com2 and com3. I would like to use interactive rebase. When I interactive rebase, should I select to edit just com1, or…
0
votes
1 answer

Why is "master" required in git pull --rebase origin master but not git rebase -i origin?

When I want to rebase against remote master, I use git pull --rebase origin master If I use git pull --rebase origin I receive the error You asked to pull from the remote 'origin', but did not specify a branch. Because this is not the default…
user5965026
  • 465
  • 5
  • 16
0
votes
0 answers

Git rebase stuck on Waiting for your editor to close the file

I'm using VS Code. I just executed git rebase -i origin/master which opened up the configuration window (for selecting which commits you want to work with) in a new VS Code instance. I changed one commit to the edit option, saved it, and closed…
0
votes
1 answer

Which one is my previous commit when running interactive rebase?

When I run something like git rebase -i --rebase-merges eeb1425e0 my commits list is showed upside down, i.e., the first commit is the last and the last commit is the first: pick A Penultimate commit pick B Penult commmit pick C Latest commit #…
Evandro Coan
  • 8,560
  • 11
  • 83
  • 144
0
votes
1 answer

Git: replace commit history of Master with the history of feature branch

I'm new to interactive rebasing in Git so I made a branch where I could squash commits ( squash-branch ) just in case I ruined something. I didn't change any of the files on the branch, just the history. I merged the branch to master expecting that…
JoeS
  • 41
  • 5
0
votes
2 answers

git interactive rebase squash creates whole new branch

Here's a picture of the last part of my simple straightforward history (from SourceTree, time marches from bottom to top): So, in this situation, I asked SourceTree to do an interactive rebase on the children of the bottommost commit ("Xcode 10.2,…
matt
  • 515,959
  • 87
  • 875
  • 1,141