From my private git repository, I would like to make a single file publicly available. Is there a way to achieve this in say GitHub, BitBucket or elsewhere?
Let me be more precise. I have a Latex project containing, say:
main.tex
chapters/chapter1.tex
...
chapters/chapterN.tex
main.pdf
I would like to make main.pdf
publicly available and distribute a link pointing to it, while keeping the remaining files private. Is there a way to achieve this?
Changing a repository's visibilityOn GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. Under "Danger Zone", to the right of to "Change repository visibility", click Change visibility. Select a visibility.
No. You can fork it and it still remains private. Private collaborators may fork any private repository you've added them to without their own paid plan. Their forks do not count against your private repository quota.
Just mark your repository as private by going to your repository's Settings -> Danger Zone -> Change repository visibility.
Private repositories are only accessible to you, people you explicitly share access with, and, for organization repositories, certain organization members.
It is not possible to do it with GIT.
In your case, it's better to use some tools which can automatically export your file to another public git repo.
You can use git export tool for that.
You need to create gitexporter.config.json
like so:
{
"forceReCreateRepo": true,
"targetRepoPath": "my-open-source-repo",
"sourceRepoPath": ".",
"allowedPaths": ["main.pdf"]
}
and then run npx giteporter gitexporter.config.json
.
These tools create a new repo my-open-source-repo
with the same commit history as your current .
repo. The my-open-source-repo
repo will contain only your main.pdf
file and its history.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With