Git: Publish from a specific commit ahead, keeping the old story private but provable

I have been understanding the library for quite some time and had many commits in my repository private:

A -> B -> C -> D -> E

Finally, I am nearing the completion of the first version and want to publish it on a remote device with the name publicfrom D, supporting A..Cfor myself, so it publicshould look like this:

D -> E

Upon request, I would like to be able to prove how I came to D(think about copyright, etc.). Since (at the moment) it is practically impossible to reprogram the hash of the commits in a chain with time and changes, I thought that holding the pointer to the Dparent pointer to Cwould be one of git's brilliant advantages, Unfortunately, I cannot find a way to make this work.

So, how can I click D -> Eon public, making it a fully functional public repository with all the necessary objects included in the checkout Dor Eand Dstill pointing to Cas the parent

What does not work:

range tap

git push public D..E:master
error: src refspec D..E does not match any.
error: failed to push some refs to '<public>'

any form of rewriting / rewriting history

, squashing A..D , C A..C. ( : C B, , B - .)

C squash, parent, ?

, , , ...

, , local_public , public :

git clone --depth 2 file:///<abspath_private> local_public

git log --pretty=raw

, local_public D -> E commit, tree parent , , .

, public local_public, , :

 ! [remote rejected] master -> master (shallow update not allowed)

, ?

+4
1

, , .

Git . ( null, root). .

D → E , D, HASH of D, , , E ( E ).

+1

Source: https://habr.com/ru/post/1618723/


All Articles