Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove local and remote branches in a single "Delete..." action #3486

Open
hasecilu opened this issue Apr 8, 2024 · 4 comments
Open

Remove local and remote branches in a single "Delete..." action #3486

hasecilu opened this issue Apr 8, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@hasecilu
Copy link

hasecilu commented Apr 8, 2024

Is your feature request related to a problem? Please describe.
I'm always frustrated when after a PR is merged to main I had to delete local and remote branches in 2 actions instead of one.

Describe the solution you'd like
Add a option that says "b Delete both local and remote branches"
image

@hasecilu hasecilu added the enhancement New feature or request label Apr 8, 2024
@mark2185
Copy link
Collaborator

mark2185 commented Apr 8, 2024

I used to use this custom command, might be a good workaround for you:

- key: 'D'
  command: >-
    git push {{ .SelectedLocalBranch.UpstreamRemote }} -d {{ .SelectedLocalBranch.UpstreamBranch }} &&
    git branch --delete {{ .SelectedLocalBranch.Name }}
  context: 'localBranches'
  stream: true

@hasecilu
Copy link
Author

hasecilu commented Apr 8, 2024

Thanks for the command, it's working!
I would only add description: "Delete both local and remote branches" to have a tip when pressing ?
image

@mark2185
Copy link
Collaborator

mark2185 commented Apr 9, 2024

Great!

It would probably benefit from a confirmation popup as well, but I'll leave that as an exercise to the reader :)

Btw just a question regarding "Pull from upstream to master", what does that do? Is it the same as p?

@hasecilu
Copy link
Author

hasecilu commented Apr 9, 2024

I use it to sync local master branch with upstream's master branch, need to set upstream (the main repo) remote before

  - key: "U"
    context: "localBranches"
    command: "git pull upstream master"
    description: "Pull from upstream to master"

I just changed to

    command: >-
      git pull upstream {{ .SelectedLocalBranch.Name }}

and now also works on main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants