Skip to content

Commit b244767

Browse files
committed
Update Readme
1 parent 5ee6d3b commit b244767

File tree

2 files changed

+71
-3
lines changed

2 files changed

+71
-3
lines changed

README.rst

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
git-wipe: A command-line tool that helps you clean up fork branches that have been merged into parent as Pull Requests
2-
=====================================================
1+
git-wipe: Cleanup your fork branches which were merged as PR to parent repository
2+
=================================================================================
33

44
.. image:: https://coveralls.io/repos/github/povils/git-wipe/badge.svg?branch=master
55
:target: https://coveralls.io/github/povils/git-wipe?branch=master
@@ -9,3 +9,70 @@ git-wipe: A command-line tool that helps you clean up fork branches that have be
99

1010
---------------
1111

12+
13+
The problem
14+
-----------------
15+
From time to time if you have many forks and do many pull requests it is inevitable that you will have stale branches. And as time marches on the number of these branches across forks can become big.
16+
17+
The answer
18+
-----------
19+
**git-wipe** is simple command line tool to cleanup your Github fork branches.
20+
21+
Install
22+
-------
23+
24+
::
25+
26+
$ pip install git-wipe
27+
28+
Usage
29+
------
30+
In order to use **git-swipe** first you need to create your `Personal Access Token <https://github.com/settings/tokens>`_.
31+
32+
You can set this token to your environment variable:
33+
34+
::
35+
36+
$ export GIT_WIPE_TOKEN=your_access_token
37+
38+
And then you can easily:
39+
40+
41+
::
42+
43+
$ git-wipe cleanup
44+
Searching for branches. This may take a while...
45+
Founded branches:
46+
47+
povils/repo_1/Branch_1
48+
povils/repo_1/Branch_2
49+
povils/repo_2/Branch_1
50+
povils/repo_3/Branch_1
51+
52+
Total: 4
53+
Delete these branches? [y/N]: y
54+
55+
56+
Other options
57+
-------------
58+
::
59+
60+
--token instead of environment
61+
--preview just to preview merged branches
62+
--timeout set connection timeout. Default 30 seconds
63+
--skip-repository skip repository you don't want to search. Multiple
64+
--skip-branch skip branch you don't want to delete. Multiple
65+
--no-interaction do not ask any interactive question
66+
67+
Example:
68+
69+
::
70+
71+
$ git-wipe cleanup --skip-repository=repo_1 --skip-branch=develop --no-interaction
72+
73+
This command will clean all merged branches without interaction, except from fork with name 'repo_1' and except all branches with name 'develop'
74+
75+
Note:
76+
-----
77+
Only forks where you are **owner** will be involved in search. Also **master branches will never be deleted!**
78+

git_wipe/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def cleanup(token, timeout, skip_repository, skip_branch, preview, no_interactio
4040
with blindspin.spinner():
4141
repo_branches = github_client.get_merged_fork_branches(
4242
skip_repository, skip_branch)
43+
click.echo(crayons.yellow('Founded branches:\n'))
4344
except BadCredentialsException:
4445
click.echo(crayons.red(
4546
'Bad credentials. Please provide valid access token'), err=True)
@@ -52,7 +53,7 @@ def cleanup(token, timeout, skip_repository, skip_branch, preview, no_interactio
5253

5354
if False == preview:
5455
if False == no_interaction:
55-
click.confirm(crayons.green('Delete these branches?'), abort=True)
56+
click.confirm(crayons.green('\nDelete these branches?'), abort=True)
5657
click.echo(crayons.green('Deleting branches...'))
5758
with blindspin.spinner():
5859
github_client.delete_branches(repo_branches)

0 commit comments

Comments
 (0)