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

local log history is gone and all files say they are modified

I'm using Sourcetree to track text files in a large project.  There are a significant number of non-text files in the project that are not being tracked which we backup regularly.  I am generally confused by the git terminology and am hoping I'm missing something.

I was pushing a change to the repository when my computer crashed.  Coming back to sourcetree found no Log/History and all files were listed as changed.  What I'd really like to do is to restore the log history to source tree.  Looking at the various files in the .git folder nothing looks particularly amiss and I'm wondering whether I'm somehow just located on the wrong commit or otherwise disoriented.  Alternatively I'd like to be able to reclone or restore the master from bit bucket but I keep getting messages along the lines of "the large number of untracked files will be deleted".  Is there a way to get a refreshed repository without disrupting untracked files

1 answer

0 votes
minnsey Atlassian Team Aug 14, 2018

Hi

I wouldn't have expected a git push to have corrupted your repository, but anything is possible. Additionally if the repository was corrupt I don't believe Sourcetree would open it.

However as Sourcetree simply runs/interprets the Git executable it might be worth taking Sourcetree out of the mix when checking the state of the repository. If open the Terminal for the repository in Sourcetree and run:

>git log

You should see the first few lines of the git log listed, alternatively if the repository has been corrupted you should see a git error.

You can also use

>git reflog

To give you a history of what has happened to your repository
https://www.atlassian.com/git/tutorials/rewriting-history/git-reflog


Thank you for leading me down the right path.

running git log resulted in the following error
>fatal: your current branch appears to be broken

Looking up that error message I found that the \refs\heads\master file sometimes gets corrupted.  So I cloned the repository to a new folder and then copied the master file over to the old folder and everything is returned to normal.

To clarify, the crash was a computer issue not a sourcetree issue.  Sourcetree just lost it's way as a result.  All is well in the end.

Suggest an answer

Log in or Sign up to answer
TAGS
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...

4,907 views 0 12
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