E
E
EugeneNB2021-11-12 16:18:50
git
EugeneNB, 2021-11-12 16:18:50

Why is GitHub Desktop ignoring gitignote?

Greetings!
I'm just learning about git, but for now I don't have much time, I decided to try GitHub Desktop.
Everything seems to be clear, it works and visually everything is clear.
But the problem is that I can't make it ignore directories and files...

I create a local repository, add it to .gitignore

system/storage
image
*.log

but it still fixes these directories and files *.log
618e69ad9a4e8396497631.png

Most likely I'm writing something wrong or I misunderstood the meaning of gitignore... But you can somehow do so that files from certain directories are not taken into account.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dmitry Shitskov, 2021-11-12
@EugeneNB

*.log
This entry will exclude files from the root directory
**/*.log
This entry will exclude files from all directories, recursively
Read more https://git-scm.com/docs/gitignore#_pattern_format

D
Dmitry Gordinskiy, 2021-11-12
@DmitriyGordinskiy

First remove this file from the repository, then add it to .gitignore.

T
TheAndrey7, 2021-11-12
@TheAndrey7

.gitignore only affects files that are not in the repository. If they were previously committed, you will have to make a commit where these files are removed from the repository. Only after that your .gitignore will start working as it should.
Just like that, files from the repository cannot suddenly disappear.

E
EugeneNB, 2021-11-12
@EugeneNB

Tried the same thing in Sourcetree, there the ignore works fine with the same .gitignore file. Campaign with GitHub Desktop, something is wrong with me. It's a pity, she likes it better.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question