Skip to content

Commit 6828b0c

Browse files
committed
✨ excluding master branch by default
1 parent 284a6ef commit 6828b0c

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ $ cleanup branches --has-multiple-repos projects
6161

6262
To find out which branches are gone on the remote, cleanup uses the output of `git branch -vv`.
6363

64-
```shell script
64+
````shell script
6565
$ git branch -vv
66-
* master 34a234a [origin/master] Merged some features
67-
feature/1 34a234a [origin/feature/1: gone] Implemented endpoints
68-
feature/2 3fc2e37 [origin/feature/2: gone] Added CLI flags
69-
```
66+
* master 34a234a [origin/master] Merged some features
67+
feature/1 34a234a [origin/feature/1: gone] Implemented endpoints
68+
feature/2 3fc2e37 [origin/feature/2: gone] Added CLI flags
69+
````
7070

7171
Based on that output, cleanup performs `git branch -d <branch>` on all gone branches. Maybe you've been doing the same thing manually for each branch in each repository.
7272

cleanup.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func Branches(path string, options *BranchesOptions, w io.Writer) error {
6666
}
6767

6868
exclude := strings.Split(options.Exclude, ",")
69+
exclude = append(exclude, "master")
6970

7071
for _, repo := range repositories {
7172
deleted, err := deleteBranches(repo, options.DryRun, exclude)

main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ func main() {
2727

2828
cleanup := &cobra.Command{
2929
Use: "cleanup",
30+
Aliases: []string{"git-cleanup"},
3031
Short: `💫 Remove gone Git branches with ease.`,
31-
Version: "0.1.5",
32+
Version: "0.1.6",
3233
RunE: func(cmd *cobra.Command, args []string) error {
33-
return nil
34+
return cmd.Help()
3435
},
3536
}
3637

0 commit comments

Comments
 (0)