Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

wildfish August 13, 2018

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
Atlassian Team members are employees working across the company in a wide variety of roles.
August 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


wildfish August 15, 2018

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

Atlassian Community Events