0

Somewhat investigative question:

Can one recover a shallow git repository from a GitHub source tarball?

Desired further steps: download only the latest commit object and be able to create and push new commits to the original repo with stock git (of course viewing history wouldn't work because it's not downloaded).

Thanks!

Clarification: one can download the refs, commit trees etc from GitHub api, but wishes to limit the number of requests sufficient for creating and pushing a new commit using standard git client.

Vadim Kantorov
  • 930
  • 1
  • 10
  • 28
  • 1
    How do you propose to recover that which simply does not exist in the source? – underscore_d Nov 11 '17 at 18:13
  • Does the tarball includes the `.git` directory (where commits, refs and everything is stored)? If yes, recovering the whole history is possible, if not I'm afraid you can't. – Yannoff Nov 12 '17 at 21:00
  • 1
    I'm thinking about a source tarball such that GitHub provides, so not refs, commits etc. The goal is to be able to create a valid commit and push it using stock git, while downloading as few objects as possible through GitHub api. – Vadim Kantorov Nov 12 '17 at 21:04
  • Newer versions of git should be able to push from a shallow clone (if both client and server are new enough). – tkruse Dec 12 '17 at 04:42
  • Possible duplicate of [Git: Push shallow clone to a new remote without 'unshallow'?](https://stackoverflow.com/questions/38275371/git-push-shallow-clone-to-a-new-remote-without-unshallow) – tkruse Dec 12 '17 at 04:43

0 Answers0