Re: [BUG] Amending a shallow clone -> orphan branch
- From
- Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
- Date
- Aug 6, 2021, 12:24 UTC
- Message-ID
- <4d242c96-77e4-e59d-a7a3-c108164ba819@syntevo.com>
- In-Reply-To
- <b3083a15-f2da-0eae-b07b-8a641c613906@gmail.com>
Bagas,
Thanks for testing.
> I tested that, and below is `git status` after the test (using Git 2.32.0): > >> On branch master >> Your branch and 'origin/master' have diverged, >> and have 1 and 1 different commits each, respectively. >> (use "git pull" to merge the remote branch into yours) >> >> nothing to commit, working tree clean > > So you're amending merge commit by adding dummy file, so that your > `master` branch becomes divergent against origin. That dummy file isn't > contained in any commits that are included with that merge commit.
What you probably didn't notice is that the new commit has no parents, that is, it formed a new orphaned branch. The expected behavior is amending the top commit and keeping it connected to the previous branch.