You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-6Lines changed: 20 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ List or remove local tracked branches, which are deleted from the remote.
4
4
5
5
Because I'm tired of doing every time `git fetch -p`, `git branch -r`, `git branch` and keep comparing which branches are gone from the GitHub, but still available locally and doing `git branch -D ${branch_name}` on one by one of them.
6
6
7
-
## What does it do
7
+
## What does it do?
8
8
9
9
This command will compare your local branches with remote and show you branches that are no longer available on remote but are still presented in your local repository. You can use it to view and delete all (remotely) removed branches in one go using `--prune` flag.
10
10
@@ -19,19 +19,18 @@ This command works without the need to run `git fetch -p`, but a working network
19
19
$ npm install -g git-removed-branches
20
20
```
21
21
22
-
Please install a package globally with -g flag so that you can use it directly as a subcommand of git, like this:
22
+
Please install a package globally with -g flag so that you can use it directly as a sub command of git, like this:
23
23
24
24
```bash
25
25
$ git removed-branches
26
26
```
27
27
28
-
### Python
28
+
### NPX
29
29
30
-
It's also possible to use python instead of node.js/npm package.
31
-
Download **git-removed-branches.py** script, remove the extension and place it inside your $PATH variable so that you can use it directly as a subcommand of git:
30
+
It's also possible to use package through npx directly. Execute inside any git folder:
32
31
33
32
```bash
34
-
$ git removed-branches
33
+
$ npx git-removed-branches
35
34
```
36
35
37
36
## Usage
@@ -43,6 +42,8 @@ $ git removed-branches
43
42
This command will look through the branches that are no longer available on the remote and display them.
44
43
In case you haven't run `git fetch -p`, it will warn you to do so.
45
44
45
+
This command is safe to run and it will not alter your repository.
46
+
46
47
47
48
### Removing
48
49
@@ -52,6 +53,8 @@ To delete local branches use `--prune` or `-p` flag
52
53
$ git removed-branches --prune
53
54
```
54
55
56
+
This command will compare your local branches to the remote ones and remove, those which do not exist anymore on the remote side.
57
+
55
58
### Different remote
56
59
57
60
If you have configured remote alias to something different than **'origin'**, you can use `--remote` or `-r` flag to specify the name of the remote. e.g., to specify remote to be `upstream`, you can use:
@@ -73,3 +76,14 @@ you can force deletion by using `--force` flag or use `-f` alias
73
76
```bash
74
77
$ git removed-branches --prune --force
75
78
```
79
+
80
+
## Troubleshooting:
81
+
82
+
83
+
If you encounter error `ERR_CHILD_PROCESS_STDIO_MAXBUFFER` it is possible that your repository contains too much branches, more then 3382. ( see [discussion](https://github.com/nemisj/git-removed-branches/issues/11) )
84
+
85
+
You can fix this, by specifying NODE_MAX_BUFFER environment variable, like:
0 commit comments