0

I'm trying to clean my commit history. Now for some reason, there are merges to my main branch in my commit history, which is weird, because there was only ever one branch. Anyway, Github for Windows is telling me I cannot squash because there is a merge among the squashed commits. And yes, I have RTFM. The Github Docs specifically mention this error but omits how to deal with it!!

So what do I do??

Tried creating a new branch with cherry picked commits but that branch ended up including the entire commit history of the main branch for some God-forsaken reason.

  • To view what the history of your repo looks like : try `git log --oneline --graph main origin/main` (<- replace "main" with the appropriate name for your branch) – LeGEC May 18 '23 at 11:51
  • “because there was only ever one branch”—Then I’m guessing that you pulled (`git pull`) from a diverging remote with the default strategy, which will create merges (true merges). – Guildenstern May 18 '23 at 16:44
  • Does this answer your question? [Git: How to squash all commits on branch](https://stackoverflow.com/questions/25356810/git-how-to-squash-all-commits-on-branch) – Guildenstern May 18 '23 at 16:46
  • You should update the title (“squaq”). – Guildenstern May 18 '23 at 17:35
  • I decided to create a create a branch with no commit history and start fresh. Thanks guys! – matsvederhus May 19 '23 at 08:48
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community May 19 '23 at 12:03

0 Answers0