.gitignore file - I am brand new to GIT and sourcetree - please help! :)

Mike Davis June 15, 2013

Hi - I am BRAND NEW to both GIT and SourceTree I have decided to try and use sourcetree since its designed for beginners and I am not in a huge hurry to learn the console. My question is this: my project will require a .gitignore file because there are several folders that I need to not sync to avoid issue.

How do I create this with sourcetree? There doesnt seem to be a button to create a file and I cant figure out how to create a .ignorefile just using windows in general. All the tutorials I read say to use the console to create the file, but I dont see any git commands for source tree to create new files, only to push them, stage them, etc.

How can I create a .gitignore file, and edit its contents? I am open to a way to just do this in Windows or to use SourceTree if there is a way. Thanks~!

1 answer

1 accepted

13 votes
Answer accepted
Colin Goudie
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.
June 15, 2013

In sourcetree you should be able to right click on one of the files/folders and select ignore. This will auto create a .gitignore file for you with that particular file/folder in it.

From there, just edit the .gitignore file as you would any other file. In a text editor etc.

Mike Davis June 15, 2013

Wow that was so easy, not sure how I missed it. Thank you!

Francisco Tapia September 22, 2015

I'm running SourceTree on my mac but I'm not able to ignore some files like the: .DS_Store which don't have any meaning for my source. on my client Version 2.0.5.2 (Mac) the ignore option is grayed out. granted I already have a .gitignore file in my local repository... could that be the issue?

Chiel Stuart October 27, 2015

.DS_Stores might already be ignored by your global ignore list. From my experience with SourceTree the global list has always included that rule. To check your lists, go to Preferences -> Git -> Global Ignore List

Like Flávio Oliveira likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events