.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

8 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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,236 views 4 2
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