How to remove directory within central repository in Mercurial
I am looking to remove a directory from local and central repository. I managed to do it locally by
hg remove name_directoriy
hg commit
However, after pushing my changes to the central repository the deleted folder is still in the central repository while it is g开发者_开发技巧one locally.
How to remove directory in central repository?
Thank you
p.s. with 'remove' i mean that it does not appear but still it is in the history
What you want to do on the remote repository is:
hg update
What you've described above removes the files in that directory, and then pushes the change the removes the files up to the remote repository, but it doesn't update the working directory files on the remote repository. To update the working directory on that remote repository you need to run the update command there.
As everyone else is pointing out those files, of course, still exist in history, but if you want them out of the working dir it's the update
you're missing.
If you mean that you want to remove it from the history on the central repository, the answer is that you can't - that's not how version control works.
If you mean that your remote repository has a working directory that you want the file(s) to disappear from, then you probably need to run hg update
on that remote repo.
The idea of central repository is foreign to mercurial, all repositories are equal, so the idea of a central repository is only useful when thinking about your workflow.
What this means is that the directory is in the history of both your local copy of the repository and the one you call central.
Mercurial, as any other SCM, doesn't delete files or directories from the history, as that would defeat its whole purpose, so you'd better ask yourself why you want to delete it, is it something that really can't be there (like a directory full of sensitive medical records in a public repository) or is it just a directory that isn't needed anymore?, if the answer is the latter, just leave it alone, maybe in the future you'll be glad it's there, if you REALLY need to delete it, take a look around here.
精彩评论