A
A
Alexander Arbuzov2018-08-21 13:08:45
git
Alexander Arbuzov, 2018-08-21 13:08:45

Why don't exclusions work in gitignore?

For a Bitrix project, I set up ignoring the bitirx folder. But there are a few files in the admin subfolder that need to be monitored.
those.
bitrix - ignore
bitrix/admin - ignore
But bitrix/admin/filename.php should be tracked
In gitignore I set:

bitrix/*
!bitrix/admin/
bitrix/admin/*
!bitrix/admin/filename.php

There is no file in git status output. Those. it is not tracked. What am I writing wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
eternalfire, 2018-08-21
@arbuzzz

/bitrix/*
!/bitrix/admin/
/bitrix/admin/*
!/bitrix/admin/filename.php

S
Saboteur, 2018-08-21
@saboteur_kiev

You can not add exceptions to .gitignore, but simply add these files manually via
git add
and commit. They will be subsequently tracked despite the fact that the entire folder is in .gitignore

A
Andrey, 2018-08-21
@VladimirAndreev

even if the folder is ignored, you can say
git add /file.txt
and it will be added to git.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question