Reputation: 4506
My code structure is:
.gitignore
my-service << this is a file without an extention
charts
| my-service << this is a folder
| | file1
| | file2
When I write in my gitignore my-service
it ignores both my-service the file and my-service
the folder.
How can I ignore only the file in the root directory, and not the sub-directory?
Upvotes: 18
Views: 3746
Reputation: 4724
you can do the reverse way with!
in .gitignore
myservice
!myservice/
Upvotes: 35