abhinav / abhinav/git-spice

Better workflow for renaming remote branches

Offen
#655 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Go
Sterne
762
Forks
72
Ø Merge
18 Std. 24 Min.
Gemergte PRs (30 T.)
28

Beschreibung

gs branch rename only renames the local branch, and leaves the remote alone.
AFAIK there's no way to rename the remote ref without deleting and re-pushing.

Right now, if a user wants to rename the local branch and the remote, the workflow is:

```
git push --delete origin $oldName
gs branch untrack
gs branch track
gs branch submit
```

Without the `untrack`/`track`, the git-spice state will still remember `$oldName` as the remote name for the branch and attempt to push to it.
This behavior was intentional, so as not to accidentally disconnect from PRs after pushing a branch.
However, as evident above, this makes the case where the user _does_ want to rename the branch (maybe because they haven't created a PR) annoying.

Some options:

- in `gs branch rename`, if the branch doesn't have a PR associated, offer to rename the remote
- if we can determine in `gs branch submit` that the remote ref was deleted (maybe since we use `--force-with-lease`), use that knowledge to offer to use the new remote name

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.