Github Actions - Running `git merge` does not merge deletions from one branch to another

I’m writing an action to automate a merge/build between two project branches, but I’m having trouble with deletions not coming over in my merges. This is not a problem when I run locally on my laptop, only on the Action runner.

Here’s the setup –

I develop on the main branch - add, modify, and delete files. All changes committed to main.

I have a second release branch where the latest work from main is merged in, and a build is made and published.

When I perform the merge - git merge --no-commit -s recursive -Xtheirs main (run from release ) - most things merge over well with a preference for items coming from main . However, files deleted on main do not get deleted on release .

No conflict appears for those files, nothing special happens, and the release branch just keeps those files that were deleted on main. But I need them to be gone.

As I said, this only happens when I run these commands as an action. Locally, on my laptop? Deletes just fine. What’s up with that? Am I doing something wrong?

It turns out this was a totally different problem than what I described having to do with submodules and merging between shallow clones. I was a fool - A FOOL! - to leave out that info in the question.

Short story – Fetch deeper than 1 if you’re trying to merge anything. Fetch all the way back until the commit where the branches split! Then submodules won’t be a pain and cause conflicts, and the merge will complete - which results in deleting the appropriate files!

Sigh… coding is hard sometimes, y’all