abhinav / abhinav/git-spice

Better workflow for renaming remote branches

Aberta
#655 0 comentários 1 reação 0 responsáveis Ver no GitHub
enhancement
Linguagem predominante
Go
Estrelas
762
Forks
72
Merge médio
18h 24min
PRs com merge (30d)
28

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.