Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

[REQUEST] Add command to delete local and remote branches at the same time #789

Open
curtisgibby opened this issue Mar 29, 2019 · 4 comments

Comments

@curtisgibby
Copy link
Contributor

curtisgibby commented Mar 29, 2019

I think it would be nice if there were a single command to delete both a local branch as well as any remote tracked branches. My last Git GUI client, SmartGit, included this as a checkbox option when deleting a local branch.

delete local and remote branches

I think the following would work, added right after the existing delete-local-branch and delete-remote-branch in gitplus.js

"git-plus:delete-local-and-remote-branch": () => {
  git.getRepo().then(repo => GitDeleteBranch(repo))
    .then(repo => GitDeleteBranch(repo, { remote: true }));
},

I understand that this could potentially be done with a Custom Command, but I think that there's enough value there that it would worthwhile to include in the full repo.

@akonwi
Copy link
Owner

akonwi commented Apr 18, 2019

Yep this is a great idea. Could you open up a PR and add the command to lib/git-plus-commands.coffee too? Also, how about having the label be "Delete Branch (Local and Remote)"?

Then we can take it a step further later and prompt about deleting the remote branch if there is one while deleting a local branch

@curtisgibby
Copy link
Contributor Author

curtisgibby commented Apr 18, 2019

I like that idea. However, as far as I understand, the label is derived from the "slug" (or whatever you'd call it). How would we be able to generate the parentheses in the label from something like delete-branch-local-and-remote?

@akonwi
Copy link
Owner

akonwi commented Apr 18, 2019

The CommandRegistry::add method has a couple signatures. What you'll do is similar to the Fetch All command

@curtisgibby
Copy link
Contributor Author

PR #794 opened.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants