1

I am trying to squash a few commits from my branch before merging a pull request.

When doing git log I can scroll down to the commits I want to squash (14 commits back).

Doing git rebase -i HEAD~14 shows my comments and also commits made onto master, moving back the commits I want to squash

d1596
  • 1,187
  • 3
  • 11
  • 25
  • Are you sure that you are `checkout branch` before `git rebase --interactive`? – dunajski Jan 23 '19 at 20:13
  • Yes I did, my branch was "up to date" – d1596 Jan 23 '19 at 21:01
  • Did you checkout your actual branch that you want to rebase from master? It looks like normal situation when you checkout you have access to previous history snapshots from master. – dunajski Jan 23 '19 at 21:08
  • What do you mean by "actual branch". I did `git checkout ` – d1596 Jan 23 '19 at 21:10
  • And then you made some commits and want to squash few of them and push and merge to master, is that right? – dunajski Jan 23 '19 at 21:19
  • I want to push to my branch, if everything is fine upon review it will be merged into master – d1596 Jan 23 '19 at 21:37
  • Then squash commits in your branch and merge them to master. I wouldn't recommend you to squash commits before checkout from master. – dunajski Jan 23 '19 at 21:40

1 Answers1

0

In short that is normal situation that you see previous history commits because you checkout from master.

dunajski
  • 381
  • 3
  • 15