使用 Mercurial 忽略 manage.py (hg .hgignore)
我在 Django 项目中使用 Mercurial,并且我需要忽略 manage.py。 当我对 settings_local.py 进行更改时,我的 .hgignore
syntax: glob
*.pyc
*.html~
*.js~
manage.py
settings_local.py
media/
工作正常,但是当我更改 manager.py 时,.hgignore 不起作用
提前致谢!
i'm using mercurial for my project in Django, and i need to ignore the manage.py. I've my .hgignore like this
syntax: glob
*.pyc
*.html~
*.js~
manage.py
settings_local.py
media/
when i make changes to settings_local.py it working fine, but when i change manage.py the .hgignore does not work
Thanks in advance!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
.hgignore
文件仅告诉相关命令,以避免在您要求它们通过扫描目录并查找新文件和已删除文件来查找要添加到存储库的文件时拾取新文件。我能记得的两个,可能还有更多,是:
就这样了。如果您在告诉 Mercurial 忽略某个文件之前将其添加到存储库,或者在忽略该文件的情况下专门将其添加到存储库,则 Mercurial 将开始跟踪该文件。
一旦开始跟踪,就会继续跟踪。
换句话说,无论您是否在 .hgignore 中指定了该文件,以下命令都会要求 Mercurial 开始跟踪该文件:
无论您在编辑 .hgignore 之前还是之后执行此操作 文件无关紧要。
您的问题听起来像是 Mercurial 已经在跟踪此文件。要让 Mercurial 停止跟踪文件,请发出忘记命令:
然后进行提交。此后,Mercurial 将不会拾取对该文件的更改。
The
.hgignore
file only tells relevant commands to avoid picking up new files when you ask them to find files to add to your repository by scanning the directories and finding new and removed files.The two I can remember, there might be more, are:
That's it. If you either add a file to the repository before you tell Mercurial to ignore it, or specifically add a file to the repository even though it is being ignored, then Mercurial will start tracking the file.
And once it has started tracking it, it will keep on tracking it.
In other words, regardless of whether you have specified the file in
.hgignore
, the following command will ask Mercurial to start tracking the file:Whether you did this before or after you edited the
.hgignore
file is irrelevant.Your question sounds like Mercurial is already tracking this file. To get Mercurial to stop tracking the file, issue a forget command:
and then do a commit. After that, changes to that file will not be picked up by Mercurial.
Manage.py 是否位于根文件夹中,如果是,则在创建忽略文件之前将其添加到存储库中(因此它已被跟踪)。如果是第二种情况,那么只需告诉 Hg 忘记文件
hg忘记manage.py
是我相信的语法。Is the manage.py in the root folder, and if so was it added to the repo before the ignore file was create (thus it is being tracked already). If the second is the case then just tell Hg to forget the file
hg forget manage.py
is the syntax I believe.只需确保您没有添加 .hgignore 文件即可。
如果您确实忘记了 .hgignore,然后再次提交。
这应该在下一次提交时忽略您的manage.py!
just make sure you've not added your .hgignore file.
If you did just forget .hgignore and then commit again.
This should ignore your manage.py with the next commit !