Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a Git clone without content possible? [duplicate]

Tags:

git

My context is the following:

  • I want to do some operations on Git, that are only possible on a local repository.
  • I don't care about the content of history, even the current content. Only the metadata (commits, authors, dates, ...) are from interest.

So I would like to have a local Git repository that contains the least amount of data, to allow operations like:

  • Do a branch, and push it.
  • Do a tag, and push it.

Is something like that possible at all? I know already what a bare repository is (it gives you all commits including the file data), and I have read about git shallow clone, but both give me with the commits all data.

like image 664
mliebelt Avatar asked Jul 25 '26 08:07

mliebelt


1 Answers

No, what you are asking (to have commits without the actual content) is fundamentally not supported by git. Depending how your remote is hosted, the hosting server might provide API's that you could use to manipulate refs (branches and tags) without having to clone, but that's about it.

like image 147
Mark Adelsberger Avatar answered Jul 26 '26 20:07

Mark Adelsberger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!