管理许多git存储库 [英] Managing many git repositories

查看:142
本文介绍了管理许多git存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置一个项目在git中很容易,所以即使对于小脚本我也可以有单独的仓库。现在的问题是如何管理它们。



我使用这些存储库在多个地方工作。当我对某个版本库进行更改时,我希望能够更新其他地方的版本库。



因此,我有一个包含许多存储库的目录。


  1. 如何获取所有这些变量?

  2. 如何检查其中是否有未变更的变更?


  3. $ b 只需一个命令就可以完成这些任务。



    输出需要保持沉默,才能真正注意到要做的事情。

    解决方案

    看起来像编写一个脚本来做这件事很容易。本质上它需要迭代存储库,然后使用git ls-files,git diff和git log命令。


    Setting up a project is easy in git and so I can have separate repository even for small script. Now the problem is how to manage them.

    I work in multiple places with these repositories. When I have done changes to some repository, I want to be able to update the repositories in other places.

    So I have a directory with many repositories in it.

    1. How can I fetch all of them?
    2. How can I check whether any of them have uncommitted changes?
    3. How can I check whether any of them have changes to merge?

    And it would be nice to be able to do these with one command.

    The output needs to be silent enough to actually notice the things to do.

    解决方案

    Looks like writing a script to do it is quite easy. Essentially it needs to iterate over the repositories and then use commands like git ls-files, git diff and git log.

    这篇关于管理许多git存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆