SourceTree can't see current file contents

Peter Mauger February 19, 2014

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
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2014

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.

0 votes
Peter Mauger February 19, 2014

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

KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 19, 2014

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) ;)

Peter Mauger February 19, 2014

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
TAGS
AUG Leaders

Atlassian Community Events