简体   繁体   中英

Mercurial (hg) ignore my change on file but keep updating

Is it possible that I could use mercurial (hg) to ignore the changes on my local but always get the latest one and remind me of the changes when conflicts?

eg I have a pom.xml file which use a less plugin, but I definitely dont want the less plugin get run every time when I change a file in the eclipse and it triggers the maven update. But I will need it when it goes to production.

So is it possible I could just ignore my changes on the pom.xml file (comment out the less plugin) but not commit it and still get the updates when some other changes on pom.xml incoming.

You can't do this with .hgignore , as that only instructs Mercurial which untracked files to ignore.

You can achieve what you want by not committing changes to pom.xml:

hg commit --exclude pom.xml

You'll need to remember to will be a manual operation every commit, or you can add something like the following to your .hgrc or Mercurial.ini:

[alias]
mycommit = commit --exclude pom.xml

hg mycommit will now always exclude pom.xml

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