How to make private repo public
How to make private repo public
Can I make releases public from a private github repo?
I have an application which is in a private github repo, and am wondering if the releases could be made public so that the app can auto-update itself from github instead of us having to host it.
Additionally I’m wondering if it’s possible to use the github api from the deployed app to check for new updates.
4 Answers 4
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
A workaround would be to create a public repo, composed of:
That way, you have a visible repo dedicated for release hosting, and a private repos for source development.
As @VonC mentioned we have to create a second Repository for that. This is not prohibited and i am doing it already. With github workflows i automated this task, I’m using a develop / master branching, so always when I’m pushing anything to the master branch a new version is build and pushed to the public «Realease» Repo.
In my specific use case I’m building an android apk and releasing it via unoffical github api «hub». Some additional advantage of this is you can have an extra issue tracker for foreign issues and bugs.
The 2022 answer to this question is even more straight-forward. You’d just need to use the pre-installed gh CLI:
This command will create a tag v0.0.1 and a release with the local file foobar.zip attached on the public repository. You can run this in the GitHub Action of any private repository.
One thing is important here: GITHUB_TOKEN must still be set as the token of the repository you’d like to release on!
I’m using a slightly more advanced approach by setting:
How can I switch a public repo to private and vice versa on GitHub?
I can’t seem to find a way to do this. Is it possible at all? Since this is kind of important in my case, is there a code management platform where this is possible?
3 Answers 3
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
Instead of switching back and forth between GitHub repository visibility status (which is possible through the repository settings, section «danger zone»), I would rather establish 2 repositories:
You can now set your repository to any available visibility option – public, private, or internal – from a single dialog in the repository’s settings.
Previously, you had to navigate separate sections, buttons, and dialog boxes for changing between public and private, and between private and internal.
(*) «destructuve action» because of the consequences of the visibility change:
public to private: some features won’t be available in the repository after you change the visibility to private. Any published GitHub Pages site will be automatically unpublished.
GitHub Advanced Security features, such as code scanning, will stop working
private to public: GitHub will detach private forks and turn them into a standalone private repository
Note that, since July 10th 2020, the default visibility is private:
Default visibility for new repositories
When you create a repository, you can choose whether it should be private or public.
Now, when you’re signed into GitHub through an organization’s single sign on service and create a new repository through the website navigation, the default selection is Private.
This helps prevent sensitive company data from unintentionally being pushed to public repositories. See the about repository visibility article for more information about this choice.
GitHub: Make a private repository partially public
I have built a project with html + css + javascript on GitHub for a half year. It has been in a private repository, there is only one branch.
Now I want to make this repository partially public, such that:
Users can use the issues feature to ask questions or write requirements, I could respond to them, we could have discussion.
Actually, users don’t need to see the code. But as we are on GitHub, I may want to make a small part of files public.
I don’t want to lose the commit history.
Could anyone tell me what are the steps (and commands ideally) I should follow?
Do I have to re-organize my folders, for example, make a public folder and a private folder?
3 Answers 3
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
The first thing to understand is the GitHub permissions model. To submit issues, etc. requires some level of permission to a repo. Read should be sufficient.
But read does also mean «able to see all code and history». And able to see even means able to copy and fork, even though you control what can be written back to your repo. And there is no access level lower than «read (all the code)».
So if you want to keep your code to yourself, then creating some sort of project page apart from github, and tapping into a dedicated issue tracking system there, may just make more sense for what you’re trying to do.
If you do decide that some code should be public, then you’d have to have two repos. The repo with the public code could be made read only, or read/write if that better meets your needs for that subset of the code. Either way it could then host issue discussions, etc.
If only current versions need to be made public, then it’s straightforward. You init the new repo, move the files from one to the other, create the submodule link if you want it.
If you do split the history, you’ll probably still want to keep the history of the public files in the original repo simply because linking the repos’ histories is rather difficult. It’s not a huge practical limitation most of the time, unless the size of the history is considerable.
Git private and public repos for the same project
Question from a Git newbie: I have a project in a Git repository, parts of which I would like to make available as OSS. For practical reasons, the repositories of the private and the public parts of the project will have to be different, while all development will happen in the private repository. At certain points in time, I would like to update the OSS version with selected commits from the private version.
Right now, I have a remote branch of the private repo setup in a local mirror of the public repo and I am using git cherry-pick to copy the interesting commits from the remote branch of the private repo to master branch of the public repo, which I then push. However, since the private development is moving very fast, cherry picking can be very time consuming.
Are there any suggestions on how to make the workflow a bit better?
BTW, I did read SO questions #999064 and #1807036
3 Answers 3
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
If you maintain a lastsync branch like this in addition to the above, you can replace private^10 with lastsync and not have to track rev counts:
While what I am about to suggest is probably similar to the answer from #999064, I will give it a go.
So what you get is:
master contains the commits a, b, d, f, g. work contains the merge commits c (contains a, b), h (contains d, f, g), and the regular commit e.
e is only on the work branch, while all other commits (except merge commits) are on both branches.
An example for how to produce the above graph:
Make private repo contribution history public
I would like to show a client my contribution history towards a project, without making the repo public. Is there a way to do this through github (eg: not taking screenshots of everything).
Ideally they could see at least the number of contributions towards the project; it would be great if they could also see the graph features (punch card, timeline, etc.).
Is this possible?
3 Answers 3
Trending sort
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
Switch to Trending sort
I created a script that solves this problem:
It will transfer all of your commit messages and dates for a given email address out of an existing repo and into a dummy repo that you can then push up to your GitHub account. It won’t transfer source code, project names, or project team members’ commits.
EDIT You can now show private contributions on your GitHub profile page.
No, this is not supported through the GitHub website, unless you want to create an «organization» and give the client read-only access to the whole repo.
Clone the repo locally and use the git log command to dump the project history to a text file. You can then give the client this text file. This won’t give you GitHub’s visualizations, but you could make some of your own in Excel or some other program.
Источники информации:
- http://stackoverflow.com/questions/57836411/how-can-i-switch-a-public-repo-to-private-and-vice-versa-on-github
- http://stackoverflow.com/questions/44261626/github-make-a-private-repository-partially-public
- http://stackoverflow.com/questions/4896095/git-private-and-public-repos-for-the-same-project
- http://stackoverflow.com/questions/17138381/make-private-repo-contribution-history-public