in mercurial what is the best way to ignore changes to a file without removing the working copy from anyone's repository

こ雲淡風輕ζ 提交于 2019-12-13 02:44:43

问题


I don't want this file to be removed from other developer's machines, but I don't want it tracked anymore either. It is basically a setting file, that shouldn't have been checked in in the first place.

I think I have to tell the other developers to back up this file. Then I can do a remove, and add it to the .hgignore. Then they have to put the file back into their working directory.

It seems like hg forget would only work for my machine, and then next time another developer does a pull it would wipe out their file.

Any tips?


回答1:


They don't need to back it up. It's backed up in the repository. You might want to get them to commit their latest version before they pull from you so they don't lose their latest changes. When they lose their file they can just do hg log <file> and then hg revert <latest revision - 1> <file> to get it back.




回答2:


It seems like hg forget would only work for my machine, and then next time another developer does a pull it would wipe out their file.

Yes, non-versioned file will be saved (some time) only in your WC

If you don't want kill file and just ignore, you can

  • use -X filename on commit by hand (or write in aliases section)
  • install (on all workplaces) Exclude Extension (semi-automated solution from p.1)


来源:https://stackoverflow.com/questions/13282504/in-mercurial-what-is-the-best-way-to-ignore-changes-to-a-file-without-removing-t

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!