I requested pr#1 from origin/master to upstream. Then I created a new branch ipython_feature while checkout in the master. Before merging pr#1 I requested pr#2 which has some changes with pr#1. Later mt pr#1 has merged successfully. Now I could not squash the last 6 my commits from the ipython_feature branch.
I couldn't squash all my commits. Any help will be appreciated on how to squash in this scenario?
I used git rebase -i Head~6
in the ipython_feature branch but returns fatal: invalid upstream 'Head~6'
.
Asked
Active
Viewed 100 times
0

Loghi Perinpanayagam
- 300
- 2
- 11
-
how many commits it shows when you git log in iphthon_feature branch? and another thing isn't it would be HEAD not Head? – Md Golam Rahman Tushar Jun 06 '20 at 10:16
-
It shows 13 commits. And yes that would be the HEAD – Loghi Perinpanayagam Jun 06 '20 at 10:27
-
so it was a typo right? I mean here, but you did the command right but still you have the problem, right? – Md Golam Rahman Tushar Jun 06 '20 at 10:34
-
yes.Anything related to the upstream merge? – Loghi Perinpanayagam Jun 06 '20 at 10:49
1 Answers
1
fatal: invalid upstream 'Head~6'
Note that HEAD
and Head
are not the same; hence the error message. It’s also confusing because the word “upstream” is being used in two completely different ways. — If you just want to squash the whole branch, you do not need interactive rebase. Say
git checkout ipython_feature
git reset --soft HEAD~6
git commit -m"message"

matt
- 515,959
- 87
- 875
- 1,141