Add working copy and SourceTree wipes the .git folder

I just updated to v2.0.2 so maybe I'm just misunderstanding something. I cloned a git repo using terminal. Afterwards, I decided I wanted to work in SourceTree instead so I clicked `[ + New Repository ]` > `Add existing local repository`, found the directory and clicked ok. The repo appears in the repo list and I open it.

There is nothing there! Nothing under any of the views. Nothing when I switch to view the full branch. I try to pull but it doesn't find any remotes or branches. No history, but when I switch to the history view, I get,

> 'git log' failed with code 128:'fatal: bad revision 'master'

So I go back to terminal and type `git branch` and there are none! All my files are intact but otherwise, it looks like this is either a brand new repo, or, perhaps, a corrupted one.

I have reproduced this several times using different repositories with different remotes. Am I doing something wrong or did I stumble on a bug?


1 answer

1 accepted

Is SourceTree set up to use "embedded" or "system" git? If it is using "embedded", but you initially cloned the repo with a newer version of git, there may be properties about the repository that causes SourceTree's older, embedded version to panic.

Yes. That was it. Actually, my system Git was behind at 1.7 while ST was using 1.8. This appears to have done the trick. Thanks a million!

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

648 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