stdcall
stdcall

Reputation: 28880

gitignore how to ignore a file and not a directory tree

I have a weird behavior with my .gitignore file

My project tree looks like this

abc
 |
 |-> inc
 |-> src
 |-> obj---
 |        |-> abc (The exeutable file)

I would like that the abc executable will be ignored so I added abc to my .gitignore file. but now, the whole abc tree is ignored.

How can I specify that I want to ignore only a file called abc, and not a directory ?

p.s

My .gitignore file:

*.so
*.o
*.a
abc

Upvotes: 1

Views: 80

Answers (2)

yonosoytu
yonosoytu

Reputation: 3319

You can include a “negative” pattern in your .gitignore file:

abc
!abc/

Upvotes: 0

poke
poke

Reputation: 387667

You could specify the path:

obj/abc

Upvotes: 1

Related Questions