It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

.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

13 votes
Answer accepted

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 (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

Like Flávio Oliveira likes this

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

3,607 views 0 11
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you