#git-repository #cleanup #unused #up #disk #clean #remote

app git-sweep

一个简单的工具,用于清理您磁盘上的未使用git仓库

1个稳定版本

1.0.0 2024年2月23日

#918文件系统

MIT 协议

16KB
163

Git sweep

一个简单的工具,用于清理您磁盘上的未使用git仓库。仓库将检查以下条件

  • 是否存在任何新的/修改的未提交的文件(未被忽略)
  • 是否存在未推送的提交(更新远程后)

请注意,该脚本使用您的git代理来检查远程状态,因此它无法离线工作。

免责声明

您完全自行使用此脚本。您最终负责决定所选文件夹是否安全删除。

$ git-sweep ~/repos/*
 /home/user/repos/repo1 Dirty local index
 /home/user/repos/repo2 Dirty local index
 /home/user/repos/repo3 Dirty local index
 /home/user/repos/repo4 Dirty local index, Ahead of origin
 /home/user/repos/repo5
 /home/user/repos/repo6
 /home/user/repos/repo7
 /home/user/repos/repo8 Dirty local index, Ahead of upstream
 /home/user/repos/repo9 Dirty local index
 /home/user/repos/repo10 Dirty local index, Ahead of origin
 /home/user/repos/repo11 Dirty local index
 /home/user/repos/repo12 Dirty local index, Error: Remote HEAD not found
 /home/user/repos/repo13 Dirty local index, Ahead of upstream
 /home/user/repos/repo14 Dirty local index
 /home/user/repos/repo15 Dirty local index
 /home/user/repos/repo16 Dirty local index, Ahead of origin
 /home/user/repos/repo17 Dirty local index
 /home/user/repos/repo18 Error: Local commit is neither ahead nor behind remote!
 /home/user/repos/repo19 Dirty local index
 /home/user/repos/repo20 
 /home/user/repos/repo21 
 /home/user/repos/repo22 Dirty local index, Error: Local commit is neither ahead nor behind remote!
 /home/user/repos/repo23 Dirty local index, Error: Local commit is neither ahead nor behind remote!
? Select repos to delete  
> [ ] /home/user/repos/repo5
  [ ] /home/user/repos/repo6
  [ ] /home/user/repos/repo7
  [ ] /home/user/repos/repo20
  [ ] /home/user/repos/repo21

依赖关系

~13–43MB
~704K SLoC