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

SourceTree can't see current file contents

I ran an initial commit of all of my code on 29th January. I've been working on the code on and off and wanted to check in the changes. When I go into my repository in SourceTree all of the files show up in Files in the working tree with + symbols indicating that they are new files. Selecting any of them shows the entire contents of the file from when I checked the files in in January. I've checked the bitbucket website and the files were definitely correctly checked in on the intial checkin. When I try and commit there are no files showing up because SourceTree has decided that nothing has changed.

I haven't used source control a great deal and have run into significant problems with it in the past (including wiping out 2 months worth of work on one occasion) so I don't know how to proceed.

2 answers

1 accepted

0 votes
Answer accepted

You should be able to re-copy the directory with your latest changes into the git-controlled working copy without any issue. Just make sure that the directory where you made your changes does NOT have a hidden .git directory, as that would overwrite your repository, not just your working copy.

Egads! It turns out SourceTree decided to duplicate the entire project into an (almost) identical file path. Hence there were no changes to the files because I wasn't 'working' on the files... This is going to get messy...

SourceTree has no capability to do this unless you manually clone within SourceTree itself. There's no copy functionality, and clones are only done through the clone dialog unless you pull down a subtree/submodule (which is also a manual operation)

Source: SourceTree developer (me) ;)

I THINK that what happened was:

When I was creating the repository I tried to connect it directly to my original source code root folder

SourceTree told me it couldn't clone to a non-empty folder

I cloned to a slightly differently named folder and then copied the files across to check them in (leaving it uploading for quite a while)

When I returned to my code a few days later I COMPLETELY forgot to work in the new working folder and continued working in the original folder (which wasn't being tracked by SourceTree)

What I can't understand is why I couldn't nominate a non-empty folder as my working folder when my bitbucket repository had no files in it at all? I can understand there would be a problem if there was existing code in the repository but surely I should be able to say 'here you go empty repository, this is my working folder I've been using up until I decided to put the code under source control'???

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

708 views 0 9
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