在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:arc90/git-sweep开源软件地址:https://github.com/arc90/git-sweep开源编程语言:Python 100.0%开源软件介绍:git-sweepA command-line tool that helps you clean up Git branches that have been merged into master. One of the best features of Git is cheap branches. There are existing branching models like GitHub Flow and Vincent Driessen's git-flow that describe methods for using this feature. The problemYour As time marches on, you can build up a long list of branches that are no
longer needed. They've been merged into The answerUsing To install it run: pip install git-sweep || easy_install git-sweep Try it for yourself (safely)To see a list of branches that git-sweep detects are merged into your master branch: You need to have your Git repository as your current working directory. $ cd myrepo The $ git-sweep preview Fetching from the remote These branches have been merged into master: branch1 branch2 branch3 branch4 branch5 To delete them, run again with `git-sweep cleanup` If you are happy with the list, you can run the command that deletes these
branches from the remote, $ git-sweep cleanup Fetching from the remote These branches have been merged into master: branch1 branch2 branch3 branch4 branch5 Delete these branches? (y/n) y deleting branch1 (done) deleting branch2 (done) deleting branch3 (done) deleting branch4 (done) deleting branch5 (done) All done! Tell everyone to run `git fetch --prune` to sync with this remote. (you don't have to, yours is synced) Note: this can take a little time, it's talking over the tubes to the remote. You can also give it a different name for your remote and master branches. $ git-sweep preview --master=develop --origin=github ... Tell it to skip the $ git-sweep preview --nofetch These branches have been merged into master: branch1 To delete them, run again with `git-sweep cleanup --nofetch` Make it skip certain branches. $ git-sweep preview --skip=develop Fetching from the remote These branches have been merged into master: important-upgrade upgrade-libs derp-removal To delete them, run again with `git-sweep cleanup --skip=develop` Once git-sweep finds the branches, you'll be asked to confirm that you wish to delete them. Delete these branches? (y/n) You can use the $ git-sweep cleanup --skip=develop --force Fetching from the remote These branches have been merged into master: important-upgrade upgrade-libs derp-removal deleting important-upgrade (done) deleting upgrade-libs (done) deleting derp-removal (done) All done! Tell everyone to run `git fetch --prune` to sync with this remote. (you don't have to, yours is synced) Deleting local branchesYou can also clean up local branches by using simple hack: $ cd myrepo $ git remote add local $(pwd) $ git-sweep cleanup --origin=local Developmentgit-sweep uses git-flow for development and release cylces. If you want to
hack on this with us, fork the project and put a pull request into the
To run the tests, bootstrap Buildout and run this command: $ git clone http://github.com/arc90/git-sweep.git $ cd git-sweep $ python2.7 bootstrap.py ... $ ./bin/buildout ... $ ./bin/test We also use Tox. It will run the tests for Python 2.6 and 2.7. $ ./bin/tox Requirements
LicenseFriendly neighborhood MIT license. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论