I'd like to continue to push (almost) all branches with a simple git push
command, but there are a few things I'd like to be able to keep in Git locally without sharing them with the rest of the world.
The things I'm keeping locally include private changes to public files—hence, I'd like to keep the secret stuff in an appropriately named branch that doesn't get pushed to the server. Is this a thing?
Just create branches in some namespace like private
- git checkout -b private/mybranch
. As long as that namespace is not existing on the remote repo, any branch in that namespace will not be pushed when you do git push
To also prevent pushing by explicit, set the branch.<name>.remote
to some some nonexistent remote.
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