简体   繁体   中英

make Mercurial ignore the settings file in my local machine

I have a remote repository for my project. I have cloned it to my local machine. I have to change two settings file to make this project run in my local machine. How can I make mercurial to ignore the changes in these two files in my local machine, so that the settings file in the online version will not get updated with the local settings file when I push the changes to the remote server.

Mercurial (and no one does) doesn't provide such facilities.

You need to exclude those files completely and store templates or file.config.sample files in repository so that each developer sets up theirs own personal config file manually or using some build script.

You can have other ignore files besides the .hgignore in the working directory. Add this to your hgrc:

[ui]
ignore = /path/to/repo/.hg/hgignore

Create the hgignore file inside the .hg folder and edit it with the files you want to ignore. It's like an extension of the .hgignore, but only for your local copy.

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