3

I decided to backup all my github data and found this: https://help.github.com/en/github/understanding-how-github-uses-and-protects-your-data/requesting-an-archive-of-your-personal-accounts-data

I managed to get the .tar.gz file and it seems to contain all my repositories but there is no source code in there. Judging by the size, it looks like some kind of archive in objects/pack/*.pack

Is there any way to access original source code?

1 Answer 1

3
+50

it looks like some kind of archive in objects/pack/*.pack

According to Download a user migration archive:

The archive will also contain an attachments directory that includes all attachment files uploaded to GitHub.com and a repositories directory that contains the repository's Git data.

Those might be bare repositories or bundles.
Once uncompressed, try and git clone one of those folders (to a new empty folder)

The OP johnymachine confirms in the comments:

git clone .\repositories\username\repository.git\ .\repository\

Meaning repository.git is a bare repo (Git database only, no files checked out)

Sign up to request clarification or add additional context in comments.

5 Comments

git clone .\repositories\username\repository.git\ .\repository\ works like a charm.
works most brilliantly, but I am only able to get master branch. How do I get all the branches?
@Mayank Do a git branch -avv in your repository: you should see all remote branches listed as origin/xxx. A git switch xxx would update your repository with that branch content.
@Mayank If not, that means GitHub policy when exporting data is to export only the default branch.
Much Appreciated @VonC! your earlier solution worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.