Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

3,274 views 4 5
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