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

0 votes
Answer accepted

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 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,233 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