简体   繁体   中英

Git: deleted files still show in pull request but not in repo

I have a develop branch with bunch of '.history' folder full of useless files. I deleted all of them with

rm -rf .history
git add .
git commit -m "cleanup: deleting .history"
git push

The develop branch in bitbucket and locally correctly shows no.history folder anymore.

On the other branch called develop-new there is no.history folder, but are some other changes.

But when I send a PR to merge develop-new into develop, the whole.history folder shows up again as if it wants to delete it.

How do I solve it? I can't delete it since it's not there...

You have added a new commit where those folder contents have been removed.

But past commits still do have those folders.

A PR from develop-new (no folder) to develop should delete those folders, assuming there was no new commits on develop which would have modified a .history folder.

Regarding your PR, try locally:

git fetch
git switch develop-new
git rebase origin/develop
git push --force

See if your PR deletes those folders then (since it is rebased on top of origin/develop , the target branch)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM