Publish a HEAD branch without all previous commit objects

I started a local git repository. Now, at the moment, I want to publish it, say, github, but I do not want to publish the entire history of the project, only the latest version.

In particular, I would like to create a local "pub" branch, make some changes (possibly hiding confidential information) and publish the pub branch.

If I did what I said using a simple push, I found that all pub publications were published in a remote repository, which I don’t want, since confidential information will also be published.

How can this be achieved?

Thanks!

+3
source share
3 answers

.

.git , .

, , Git, , - Git. , - .

, , tarball , Git:)

+2

.

, , , git . . , dev, git patch apply git rebase -i, .

, .

+2

, git, , :)

, , :

1 - " " . 2 - , , .. . . 3 - , rsync public-draft git, . 4 - .

, "public", , "public-draft". , .

.

0

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


All Articles