0

Background

I have 3 Git repos in Windows Server 2019 Datacenter, and I am the only one has the access. They are all cloned from another server; I'm just using the server as a PC.

  • C:\repoC
  • C:\repoD
  • C:\repoK

They are all about 1 GB individually. repoK is the only one ever got corrupted. And has happend 2 times so far, but I never did anything peculiar, just normal routines.

The only difference of repoK from other repos is that it has a second remote //tsclient/C/repoK.git. (I use the server via Remote Desktop in a Windows 10 desktop, there is a bare repo C:\repoK.git in my desktop).

The Phenomena

Last time I found it corrupted is when I got to office in the morning. It returns not a git repository on every git command. but .git folder is present.

This time, it corrupted again, after I came back from supper, but differs from last time. When I use git status, it said:

No commits yet

Changes to be commited:
...

and listed all files as new.

When I use git log, it said

fatal: your current branch appears to be broken

I have pushed all things to my desktop so I'm not worried about my codes. But I wonder why it happend and how to prevent it from happening again?

lzhh
  • 852
  • 7
  • 16
  • 1
    What is you branch name ? You can try to fix the ` .git/refs/heads/branch` name: https://stackoverflow.com/questions/33012869/broken-branch-in-git-fatal-your-current-branch-appears-to-be-broken if this is the case. – dejanualex May 24 '21 at 12:37
  • Wow, I wonder what clobbered the branch file. That's the thing to figure out here: what's going around removing or overwriting these `.git/refs/heads/` files? – torek May 24 '21 at 22:40

0 Answers0