Mercurial ignore file

前端 未结 3 1365
遇见更好的自我
遇见更好的自我 2020-12-04 09:41

I\'m trying to get Mercurial to ignore a configuration file, but I\'m failing to get it working.

I have created a repository on my server with hg init a

3条回答
  •  孤城傲影
    2020-12-04 10:14

    Even if you have ignored files, Mercurial will track them once they have been added to the repository.

    To remove your config file from the repository, you can use

    hg remove -Af file.cfg
    

    This will remove the file from from the repository (once committed) without deleting your local file. See hg help remove However, there is now a delete recorded in the repo, and Mercurial will remove that file when your or anyone else updates across that revision.

    You could also rename it and have people copy the master to their local file, but you will need to coordinate updates of the local file.

    hg rename file.cfg file.cfg.example
    

提交回复
热议问题