|.hgignore for a CakePHP application?||#1|
We(re using CakePHP for a new application, and we use Mercurial as the source control tool. (Mercurial uses one
file in the root directory, unlike (for example) CVS that uses
in any directory.)
I(d like to exclude the content of the
directory from the source control (since they change all the time, and can be regenerated), but I can(t add
, since then the standard directories under
, and also
, ...) would be missing from new clones made by
, resulting in errors.
Currently I have in my
It would be good to have a "standard" one that could be used in all projects. Can someone suggest a complete solution?
posted date: 2009-04-10 10:37:00
|Re: .hgignore for a CakePHP application?||#3|
If I understand the question correctly you want to ignore file in tmp, but not files in certain directories in tmp. If that(s right then I think you can do so using this:
That says ignore anything that starts with tmp, unless the next part is cache, log, sessions, test. For these files:
.`-- tmp |-- cache | `-- afile `-- tmpfile
here is the
$ hg stat? .hgignore? tmp/cache/afile
I will note, though, that Cake is probably telling you not to put those files into source control based ont heir being in a tmp directory. Are you sure they(re not something htat your build system is supposed to create? Sessions in particular sound pretty transitory.
posted date: 2009-04-11 10:29:00
|Re: .hgignore for a CakePHP application?||#4|
You can add
file and Mercurial will from that point on ignore all files under
with the exception of files tracked by Mercurial. See
hg help patterns
for more about file name patterns.So if you do
% touch app/tmp/cache/.empty% touch app/tmp/logs/.empty% hg add app/tmp/cache/.empty% hg add app/tmp/logs/.empty
and make a clone, then the
directories will be created and new files in those directories will be ignored. I think that is what you want?This is also useful for tracking something like
since you would want to ignore most files by default and only track explicitly added files.
posted date: 2009-05-22 00:55:00
|Re: .hgignore for a CakePHP application?||#5|
In my own checkouts (from SVN), when the site was deployed, the ./tmp/ directory needed to have some specific permissions.I removed it from version control entirely, and my deployment script created the directories as required.
posted date: 2009-06-02 09:13:00
|Re: .hgignore for a CakePHP application?||#6|
That is exactly what I do when using CakePHP, but I use Git and not Mercurial. This way the folder structure is maintained but the actual contents of the directories are not saved.
posted date: 2009-06-11 08:03:00
|select page: « 1 »|