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

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

5 votes
Colin Goudie Community Champion Jun 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.

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

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?

.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

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

649 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you