Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

SourceTree ignore everything except one extension

Hrvoje Velicki
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 27, 2016

How to define in gitignore to ignore all except one file extension?

So I just want to track one file extensions.

 

I try something like this -> !*.sql 

but this not working.

 

2 answers

1 accepted

0 votes
Answer accepted
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 27, 2016

Read here: https://git-scm.com/docs/gitignore

"An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again"

As said, you have to exclude everything first (with pattern '*') , then include some patterns again (your desired '!*.sql').

 


0 votes
Hrvoje Velicki
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 27, 2016

Tnx! wink

It works!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events