管理许多 Git 代码库

16 浏览
0 Comments

管理许多 Git 代码库

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

我在多个地方使用这些代码库。当我对某个代码库进行了更改后,我希望能够更新其他地方的代码库。

所以我有一个包含许多代码库的目录。

  1. 如何获取它们所有的代码库?
  2. 如何检查它们是否有未提交的更改?
  3. 如何检查它们是否有需要合并的更改?

如果能用一条命令来完成这些就好了。

输出需要足够静默,以便能够注意到需要做的事情。

0
0 Comments

在管理多个git存储库时,可能会遇到以下问题:

1. 难以管理多个不同版本控制系统的存储库。

2. 同步多个git/mercurial存储库的速度较慢。

3. 管理存储库列表不够简单和快捷。

为了解决这些问题,可以使用mr工具来管理多个git存储库。mr具有以下优点:

1. 支持多种版本控制系统,不仅限于git。

2. 可以并行执行多个任务,提高同步速度。

3. 使用'mr register'命令可以快速管理存储库列表,而无需修改自定义脚本中的项目列表。

此外,根据命令行开关'-q',可以调整输出的详细程度。默认输出以简洁清晰的摘要形式呈现。

为了方便使用mr命令,并确保mr始终使用存储在$HOME中的默认项目列表,并使用5个并行线程,可以使用以下别名:

alias mr='mr -d ~/ -j 5 '

然而,mr工具在2016年08月的版本中不支持git标签。此外,该工具在安装页面中没有提及Windows,但作为Perl脚本,它可能可以在Windows上运行。

如果需要定义自己的命令,可以使用以下命令:[DEFAULT] tag = git tag "$@"。此外,可以使用别名pa='find . -name .git -print -execdir git pull \;',然后只需使用pa命令即可。

至于该工具是否免费以及是否存在缺点,文章中没有提到相关信息。

0
0 Comments

在管理许多git仓库时,出现问题的原因是目前已有的解决方案都存在一些不足之处。作者尝试了mr、repo和git-submodules,但发现每个工具都有不同的问题。因此,作者决定自己开发了一个成熟的工具mu-repo,它具有以下功能:

- 克隆多个仓库

- 在多个仓库中查看和编辑当前的更改

- 预览即将到来的更改

- 在多个仓库中并行运行命令

- 创建仓库组

- 在多个仓库中运行非git相关的命令等

需要注意的是,mu-repo支持任何Python可运行的操作系统。然而,mu-repo不支持非git仓库。因为它的目的只是处理git而不是其他版本控制系统。如果需要支持其他版本控制系统,请使用其他工具。

0
0 Comments

Managing many git repositories can become complicated and time-consuming, especially when you need to keep track of multiple repositories and their respective branches and tags. This can lead to difficulties in organizing and managing the repositories efficiently.

One solution to this problem is to use a tool called gr (git-run), which extends the functionality of mr but specifically for git repositories. gr provides an easier way to organize multiple git repositories using its tag system.

However, it should be noted that the code for gr is not well maintained. Nevertheless, if you are using bash, you can still utilize gr effectively by using the -t tag format instead of the #tag format.

Fortunately, development on gr seems to have resumed to some extent. You can check the contributors on GitHub to see that there has been recent activity and involvement in improving the tool.

In conclusion, the problem of managing many git repositories efficiently can be addressed by using tools like gr (git-run) which provides a tag system for better organization. Although the code for gr is not well maintained, it can still be effectively used in bash by using the -t tag format. The recent activity on the gr GitHub repository suggests that there may be ongoing improvements and support for the tool in the future.

0