windows – 一次检查所有git存储库的状态
发布时间:2020-12-14 02:54:44 所属栏目:Windows 来源:网络整理
导读:介绍 为了检查git repositores的状态,可以从存储库的根目录发出git status. C:pathtogit_repositoriesgit_repo_1git statusOn branch masterYour branch is up-to-date with 'origin/master'.nothing to commit,working directory clean 如果目录由多个
介绍
为了检查git repositores的状态,可以从存储库的根目录发出git status. C:pathtogit_repositoriesgit_repo_1>git status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit,working directory clean 如果目录由多个目录组成,例如50个git存储库 C:pathtogit_repositories>dir Directory of C:pathtogit_repositories .ssh git_repo_1 ... git_repo_50 0 File(s) 51 Dir(s) 也不 C:pathtogit_repositories>git status . fatal: Not a git repository (or any of the parent directories): .git 也不 C:pathtogit_repositories>git status ./. fatal: Not a git repository (or any of the parent directories): .git 能够检查所有存储库的状态 题 如何一次检查所有git存储库的状态? 解决方法
您可以使用更改为每个目录的for循环,执行git状态,然后更改备份:
for /f "tokens=*" %a in ('dir /ad /b') do cd %a & git status & cd .. 如果在批处理文件中使用它,则需要将百分比加倍: for /f "tokens=*" %%a in ('dir /ad /b') do cd %%a & git status & cd .. 编辑: 正如Cupcake所建议的那样,你可以这样做: for /f "tokens=*" %a in ('dir /ad /b') do git --git-dir=%a/.git --work-tree=%a status 这感觉就像一个更健壮,更灵活的解决方案(例如,您可以更轻松地调整它以使用存储在文本文件中的路径列表). (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 权限 – 如何在Windows 2008服务器上设置中央存储库
- 在Windows Server上安装RequestTracker(RT)?
- 在Windows和Linux机器上使用Java程序创建新文件夹
- windows下zendframework项目环境搭建(通过命令行配置)
- windows-server-2008-r2 – 如果使用Kerberos保护IIS托管站
- Windows批处理脚本 – 将文件名读入变量
- 批处理文件 – DOS:找到一个字符串,如果找到,则运行另一个
- 专用Intranet级Nuget订阅源:Windows集成安全性自定义
- windows-server-2003 – 错误“当前没有可用于登录请求的登
- windows-server-2008 – Windows Server 2008磁盘大小
推荐文章
站长推荐
热点阅读