Open Source is sometimes described as “anyone can contribute”, but that’s an oversimplification. Open Source projects always have a gatekeeper or small community of gatekeepers who decide which contributions are actually incorporated into the project and which are rejected as not up to snuff or straight up bad ideas or whatever.
That’s what you meant by your first question, right? Not “how do I hide the code of future changes” but “how do I retain control over what code is added to my repo”, correct?
Even if you meant it the other way, you could theoretically do that. Open Source one version and then never release any newer versions.
To me open source means you have access to the source code. You can choose to modify it and let the author know you modified it. It’s up to the author to decide if they want to implement the changes.
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.)
Open Source is sometimes described as “anyone can contribute”, but that’s an oversimplification. Open Source projects always have a gatekeeper or small community of gatekeepers who decide which contributions are actually incorporated into the project and which are rejected as not up to snuff or straight up bad ideas or whatever.
That’s what you meant by your first question, right? Not “how do I hide the code of future changes” but “how do I retain control over what code is added to my repo”, correct?
Even if you meant it the other way, you could theoretically do that. Open Source one version and then never release any newer versions.
To me open source means you have access to the source code. You can choose to modify it and let the author know you modified it. It’s up to the author to decide if they want to implement the changes.
No, I meant that I wanted to hide old commit history.
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
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.
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.)
It’s worth noting that you can rewrite history after the fact with Git
…if you hate anyone who might have a clone that they want to pull to later.