-1

I have Git enabled source code pointing to the dead server which is no longer functioning. I'm trying to push this code into a new repository with all its past histories, tags and branches.

I removed the old origin and added the new origin. While pushing, I found out it has corrupted objects.

Using command git fsck --full I can see broken link from to, dangling blob, dangling commit and missing blob.

Does this mean the branches and tags are also affected? I'm OK with losing some of the history, but I need all the branches and tags unscathed.

How can I fix this problem?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Surya Subenthiran
  • 2,217
  • 1
  • 15
  • 22

1 Answers1

1

Does this mean the branches and tags are also affected?

It depends.

It's hard to give an educated answer to your question, because your situation may be unique in many ways. It's simply not possible to come up with a "just do a, b and c" answer given the amount of information provided.

Instead, I am going to list sources with possible solutions to the issues you've encountered.

broken link from to

Consider studying accepted answer to "How can I fix a Git error broken link from tree to tree?". The question itself sounds a lot like what you're seeing.

Per the accepted answer, it seems like there's a chance you can get rid of the error report by ditching a relevant reflog entry.

dangling blob

Consider studying answers to "Recover dangling blobs in Git".

dangling commit

These are commits that do not belong to any branch. I'd try finding all of them, and putting them on branches before migration. See "What is a dangling commit/blob in a Git repository and where do they come from?".

missing blob

It looks like you can get rid of this error by removing the missing blob. Or could it be that the blob got renamed, and it is a dangling blob now? Consider studying the accepted answer to "How can I recover from a missing blob in a Git repository?".

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
oldhomemovie
  • 14,621
  • 13
  • 64
  • 99