I’ve already asked another community of the same thing, but couldn’t get answered yet. Please help.
What I did
Yesterday, I rebased multiple commits on
main branch of my repository through
git rebase -i .
It was for the modification in commit messages, and I used the option
--committer-date-is-author-date to remain previous commit history timestamps.
But after that, some commits from
main history went wrong. I checked some
main commits via GitHub’s commit history and found this:
This is the one specific example of the entire problem. GitHub told me the commit
91d64ce does not belong to any branch , but I wasn’t sure because I thought this means
91d64ce is a dangling commit, while actually it’s not .
When I take a look at
main branch from Git GUI as below, It seems to be properly connected to parent and child, with
main for the associated branch.
git branch --contains returned
main , which I expected.
The result was same though I double checked this through
git clone -ing again to match repo status exactly.
$ git branch --contains 91d64ce450de36edb2feb86d9b45c2bf58203124 * main $ git branch -r --contains 91d64ce450de36edb2feb86d9b45c2bf58203124 origin/HEAD -> origin/main origin/main
The only problem is that wrong ‘does not belong to any branch’ notification on GitHub history of
My question is…
- What happened?
- Do commits like
- What solution should I apply to keep this repository clean?
Please consider that I’m not an expert to Git systems. Thanks in advance.