I have a config file that is versioned, lets call it Web.Config. I want to be able to keep the original versioned file in the repo as a template, but maintain my locally modified version through pulls, fetches, merges, etc. Is this possible in Mercurial?
This has been asked/answered here quite often, but I'll bite:
The way to do this is to keep a version in the repository that's a template and keep your actual modified version local-only and listed in .hgignore. For example keep the file app.config.sample
in the repo and have your build / launch scripts look for app.config
, which is listed in the .hgignore
. If you want to get fancy you can even have your launch/build scripts copy the sample file to the actual file if it doesn't exist when run.
In short, there is no good way to have a file both tracked (added) and untracked (changes aren't committed) at the same time unless you want to do it manually using commands like hg commit -I app.config
, which even with aliases, you'll eventually forget.
You can:
push -b default
(directly or as alias-command): because local branch haven't ancestors for default's head, it will not be pushed
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.