this post was submitted on 29 Mar 2024
10 points (72.7% liked)

Open Source

31072 readers
804 users here now

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

founded 5 years ago
MODERATORS
 
  • Can I opensource it in a way where changes is not open to the public?
  • I have google verification file on my git, is it ok to put it in the public?

The platform is gitlab.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 7 months ago (2 children)

No, I meant that I wanted to hide old commit history.

[–] [email protected] 8 points 7 months ago (1 children)

Ah! Yes. No reason why you couldn't. It would require making a new repo, copying the files into the new repo, and committing in one big commit before pushing to gitlab, but yeah. Definitely doable.

(I basically always do this myself. I don't start the Git repo until I want to Open Source it. So when I first Open Source it, it's a "complete" (or at least "minimum-viable-product") project and there's only one commit. Every commit I make and push thereafter is public, but there aren't any from before my first push/publish.)

[–] [email protected] 9 points 7 months ago (2 children)

It's worth noting that you can rewrite history after the fact with Git

[–] [email protected] 2 points 7 months ago

...if you hate anyone who might have a clone that they want to pull to later.

[–] [email protected] 1 points 7 months ago

Force push main with one giant squash commit.

[–] [email protected] 7 points 7 months ago (1 children)

You can always just reset your git history:

$ git reset [your first commit hash]
$ git add .
$ got commit -m "Collapse git history"
$ git push -f
[–] [email protected] 2 points 7 months ago

You'd have to collapse all branches not just one, and remove all tags, in order to clear the whole graph.

And of course you have to be allowed to – GitHub can have protected branches, protected tags, and force push protection.

Assuming you're the repo owner and can do all that it still would't affect other people's already existing clones, only new clones.