Starting out with Git and Sourcetree - importing an existing project

I'm new to both Git and Sourcetree. Currently my projects have no formal version control, but I do have a sprinkling of files that have been renamed when there's been a revision. The usual 'filename.php' and 'filename2.php' stuff. Projects also contain a fair number of images and similar files which are unchanging and also directories which I'd probably want to exclude from Git altogether.

It seems that if I set up a repository in the root directory of my project I get a lot of stuff included that I really don't want. I'm looking for a way to filter it out that's a bit cleverer than going through the file list in 'Working Copy Changes' and deleting one by one (or even in blocks).

For example, is there a way to exclude the entire 'images' directory ?

1 answer

1 accepted

This widget could not be displayed.

The easiest way would be to edit the gitignore file by hand. You can open this file by going to your Repository Settings > Advanced > Repository-specific ignore list > Edit.

Thanks, I think I can work out what to do now, provided I can get to grips with the pattern matching.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

879 views 2 3
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