Open drewdeponte opened 10 months ago
I've figured out that the best way to prevent accidentally pushing your patchstack to remote (especially important when your patchstack is main
) is to configure the branch's pushRemote
to be a different remote.
For instance, you can have a fork remote of your repository and do something like git config branch.main.pushRemote fork
.
Your patchstack's upstream branch can still be origin/main
or something like that, but it'll push to fork/main
instead. GPS will still work as you expect and create PRs for you targeting origin/main
.
Another thing that I did is to rename origin
to upstream
in case some tooling doesn't respect config and just pushes to origin without looking at config. This will prevent those primitive tools from working and pushing when you don't want them to.
The idea is to see if there is a way to prevent a push to main when using gps. Or maybe configure branches with
.git/config
in such a way where it is safer if agit push
happens.Maybe having where a push happens could be different from where a pull happens with a branch configuration in
.git/config
? Or maybe there is some other option in the.git/config
I am not aware of that would aid with this.https://git-scm.com/docs/git-config