Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial .hgignore: Some questions on how to ignore a single file

There's a particular file in my repository, libraries/database.php, that I need ignored. However, I can't get the syntax to recognize the file - I've tried **/libraries/**/database.php and libraries/database.php in glob, and ^.libraries/database.php in regex, but neither of them work. What should I do?

like image 501
jbreed Avatar asked Dec 23 '22 00:12

jbreed


1 Answers

After hours of following all the suggestions here and others found on the web, I found out that I was always doing it right in .hgignore, but .hgignore will not ignore files that are currently being tracked by mercurial.

You must do

hg forget mydir/myfile.ext

Or adding the file to .hgignore doesn't take affect.

syntax: glob
mydir/myfile.ext

Then the above will work.

like image 117
Joe Firebaugh Avatar answered Jan 13 '23 20:01

Joe Firebaugh