BarnyBroken
@BarnyBroken
Дизайнер, веб-разработчик.

Как правильно написать gitignore для путей?

Здравствуйте. Помогите правильно составить gitignore .. ибо при commit и push ругается на пути.

Сейчас у меня пути к файлам прописаны так:
<link rel="stylesheet" type="text/css" href="{STYLES_DIR}/default.engine.css">
<script src="{JAVASCRIPT_DIR}/jquery.model.js"></script>


Но так как путей для Git не видно, ругается «cannot resolve file».
Можно как-то задать условие, чтобы это игнорировало ?
  • Вопрос задан
  • 134 просмотра
Пригласить эксперта
Ответы на вопрос 1
@lorc
Из "man gitignore":


• If the pattern ends with a slash, it is removed for the purpose of the following description, but it would only find a match with a directory. In other words, foo/ will match
a directory foo and paths underneath it, but will not match a regular file or a symbolic link foo (this is consistent with the way how pathspec works in general in Git).

• If the pattern does not contain a slash /, Git treats it as a shell glob pattern and checks for a match against the pathname relative to the location of the .gitignore file
(relative to the toplevel of the work tree if not from a .gitignore file).

• Otherwise, Git treats the pattern as a shell glob: "*" matches anything except "/", "?" matches any one character except "/" and "[]" matches one character in a selected
range. See fnmatch(3) and the FNM_PATHNAME flag for a more detailed description.

• A leading slash matches the beginning of the pathname. For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".


Еще в мане есть примеры:

# exclude everything except directory foo/bar
/*
!/foo
/foo/*
!/foo/bar
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы