0

NOTE: there is an edit to this question below

I have used git clone ssh://etc before to pull a remote repository

Is there a way to clone that repository from a specific commit point?

I'm wanting to pull only what happened on master say from 1 year ago. The repo is 14 years old and huge.

If this is not possible, is there a way to clone the repo, and then locally compact everything (including all indexes and so forth) into a single "pseudo" commit as if it was the initial code commit? Thanks.

Edits:

The accepted answer found here does not work in this case. The process only pulls down a repo of the same size, and the entire history is still available (and takes up space).

owilliams@OWILLIAMS010451 ~ % du -sh xms_v*                                                                                                                                                                                3:32:56
1.6G    xms_v3
1.6G    xms_v3_ObjectExplorer
1.4G    xms_v3_shallow           <-- no change

Not shown but if I move the .git folder out of the repo, the size is only 524M.

Here is what it looks like in SourceTree: enter image description here

What I am wanting is to see a single commit with a matching the remote, and what I would a assume as a "pseudo" squashed commit prior to that, as if that was my first code commit.

Oliver Williams
  • 5,966
  • 7
  • 36
  • 78
  • 1
    Does this answer your question? [How to clone git repository with specific revision/changeset?](https://stackoverflow.com/questions/3489173/how-to-clone-git-repository-with-specific-revision-changeset) – Mark Jan 26 '21 at 03:32
  • 2
    [`git clone --shallow-since=`](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---shallow-sinceltdategt) – phd Jan 26 '21 at 05:29
  • Alas, `fatal: Server does not support --shallow-since` :(. But this would be ideal – Oliver Williams Jan 27 '21 at 09:14
  • I have also edited my answer with the results of the linked suggested answer. So far this is not a solution – Oliver Williams Jan 27 '21 at 09:55
  • what about [`git clone --depth=1 --single-branch`](https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---depthltdepthgt) – caramba Jan 27 '21 at 10:06

0 Answers0