2

Is there a way to hide a specific PR from a public GitHub repo until it is ready for review? I push code to the public repo at least at end of every day. There is a lot of work in progress in my code. Is there a way to hide commits and PR from the public repo? Or should I change my workflow and not commit the code until I'm satisfied with it.

KWriter
  • 1,024
  • 4
  • 22
  • 1
    You don't need to make the PR until you are ready. But for the commits there is no way to hide them other than not pushing the commits. – Ethan Jun 15 '22 at 20:49
  • 1
    Depending on the project it *might* make sense to make it a "work in progress" by prepending "WIP: " to the start of the PR name. This would only make sense if you want people to start looking at it, or just to mark that a issue fix is in progress. Make sure the project is ok with WIP PRs first though – joshmeranda Sep 16 '22 at 16:40
  • I like the idea about marking PRs with WIP in their name. It seems better than tagging them as drafts. – KWriter Sep 17 '22 at 08:57

1 Answers1

1

If you push your commits or open a Pull Request on the public repository, there is no way to hide the changes. You will have to change your workflow.

Keep in mind that you are pushing the entire commit history, and it is publicly available. If you accidentally commit an API key, you must manually delete the commit from history. But that action is complex. Take a look at this question.

Ante Javor
  • 156
  • 1
  • 5
  • I will then need to use private repo. Maybe I'll try to do some syncing or pure copy paste between private and public repo. I need to take a batter look at that. – KWriter Sep 17 '22 at 08:58