You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jj git push seems to pick the wrong remote to push to for tracked branches. This is quite scary, luckily the one time I accidentally pushed without specifying remote, I was blocked from pushing to a different, protected branch on origin, which prevented the private feature branch from getting pushed publicly.
I have a repo with two remote repos project and project-priv, added as origin and priv origins.
> jj branch list
colemickens/foo-spike: onlxxxuu deadb33f (empty) test commit
@priv (behind by 1 commits): swyyyvst deadbeef foo
...
but...
> jj git push --dry-run
Branch changes to push to origin:
Add branch colemickens/foo-spike to deadbeef
Dry-run requested, not pushing.
I can't tell if this is a feature request or a bug.
The text was updated successfully, but these errors were encountered:
This seems expected to me, so I think this is a feature request (but sorry about your scare!). We should probably try to improve this.
jj git push always pushes to the default remote (origin, unless you change it in the config) if you don't specify one. Since a local branch can track more than one remote, I'm not sure whether it could push to "the" tracked branch by default.
Some possibilities that come to mind:
You could name your private remote "origin", and name the public one "public" or "upstream", or you could change the default remote.
We should probably have a way to forbid pushing a branch to the remote even if the branch doesn't yet exist there (or if jj doesn't know about it yet). If branch@origin did exist, we already have a way: jj branch untrack branch@origin would prevent push from ever pushing to that remote.
In principle, we could have a "safe mode" where jj git push refuses to create branches unless you pass a flag to it. It would probably apply to branch deletion too.
Description
jj git push seems to pick the wrong remote to push to for tracked branches. This is quite scary, luckily the one time I accidentally pushed without specifying remote, I was blocked from pushing to a different, protected branch on origin, which prevented the private feature branch from getting pushed publicly.
I have a repo with two remote repos
project
andproject-priv
, added asorigin
andpriv
origins.but...
I can't tell if this is a feature request or a bug.
The text was updated successfully, but these errors were encountered: