Skip to content

Commit e76db3c

Browse files
committedFeb 16, 2023
deprecated
Signed-off-by: Ildar Asanov <ildar.asanov@dif.tech>
1 parent e965ad1 commit e76db3c

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed
 

‎README.md

+19-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1-
# Remove old branches
1+
[**DEPRECATED**] Use git commands for delete merged branches instead of this code
2+
3+
## Git commands:
4+
Original issues: https://stackoverflow.com/questions/6127328/how-do-i-delete-all-git-branches-which-have-been-merged
5+
6+
Code:
7+
```
8+
git branch --merged | egrep -v "(^\*|master|main|dev)" | xargs git branch -d
9+
```
10+
It delete all merged branches in the master|main|dev branches.
11+
12+
---
13+
14+
### Remove old branches
215

316
The script deletes old remote and local branches of your git-repository in interactive mode
417

5-
## Usage
18+
#### Usage
619

7-
### Linux
20+
##### Linux
821
Just run script.sh
922
~~~~
1023
./script.sh
@@ -22,19 +35,19 @@ exit
2235
Exited
2336
~~~~
2437

25-
### Mac OS / Windows
38+
##### Mac OS / Windows
2639
Use **Docker** and run as in Linux
2740

2841
~~~~
2942
docker run -v $(pwd):/app frops/git_remove_branches ./script.sh -m 12
3043
~~~~
3144

32-
#### Params
45+
##### Params
3346
`-m|--month` – age of making branches in the months you want to delete
3447

3548
`-f|--force` – the force mode, in which branches are deleted without confirmation. Please, be careful. I'am not recomended use this command. Use it in exceptional cases!
3649

37-
#### For example
50+
##### For example
3851
Delete branches older then 6 month:
3952
~~~~
4053
./script.sh

0 commit comments

Comments
 (0)
Please sign in to comment.