Add -d and -D options to git up command #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we merge changes and remove the remote branch, we need to manually remove the local branch. But if it is someone else that ships your code, you probably will need to remember that. Sometimes we simple try something in a exploratory branch, committing the changes for others to see some other option or maybe only to test a concept, in any of this, there's code on your branch that you maybe don't want to keep.
This options serve that purpose: offer a tool so you don't need to remember stuff like that.
How it works
It gets all your local branches that don't have any correspondent remote branch and applies the option you passed to
git up
.Just like
git branch
-d
and-D
commands work,-d
option removes branches only if they don't have any unmerged commits.-D
removes the branch even if there is changes you didn't merge on master yet: use it only if you know what you are doing!Your current branch will be preserved, even if you didn't push it yet. It will look like this: