rustworkshop / gitopolis

Manage multiple git repositories
GNU Affero General Public License v3.0
24 stars 2 forks source link
git

Gitopolis

Manage multiple git repositories with ease.

Installation

  1. Grab the latest release,
  2. unzip it
  3. put the binary somewhere in your PATH.

I suggest adding a shorter shell alias to save typing. Perhaps gm for git many or gop.

Usage

Initial setup

cd ~/repos/
gitopolis add *

Running shell / git commands in many repos

gitopolis exec -- git pull

Tagging

gitopolis tag some_tag repo1 repo2
gitopolis exec -t some_tag -- git pull

Re-cloning repos on a new machine

mkdir ~/repos/ && cd ~/repos/

wget https://gist.githubusercontent.com/timabell/87add070a8a44db4985586efe380757d/raw/08be5b3c38190eeed4fda0060818fa39f3c67ee3/.gitopolis.toml

gitopolis clone

Using shell aliases

You can't currently use shell aliases because commands are executed directly rather than passing through a shell such as bash/zsh/fish. See https://github.com/rustworkshop/gitopolis/issues/13.

As a workaround you can create git aliases that run arbitrary shell commands. See https://github.com/rustworkshop/gitopolis/issues/80#issuecomment-1803344802

Using chained commands

You can't chain commands together with && or || like this gitopolis exec -- git branch && git pull because the shell (bash etc) will parse the && before it ever gets to gitopolis.

As a workaround you can create git aliases that run arbitrary shell commands. See https://github.com/rustworkshop/gitopolis/issues/80#issuecomment-1803344802

State file

Creates a single simple .gitopolis.toml file that you can edit, read, share with others and copy to other machines.

[[repos]]
path = "gitopolis"
tags = ["tim"]
[repos.remotes.origin]
name = "origin"
url = "git@github.com:timabell/gitopolis.git"

[[repos]]
path = "schema-explorer"
tags = ["tim", "databases"]
[repos.remotes.origin]
name = "origin"
url = "git@github.com:timabell/schema-explorer.git"

[[repos]]
path = "database-diagram-scm"
tags = ["databases"]
[repos.remotes.origin]
name = "origin"
url = "git@github.com:timabell/database-diagram-scm.git"

View as gist.

TOML is a well-supported config markup with parsers for many programming languages.



The name

Think a metropolis of git repos.

It's a lot to type as a name, but it's nice and unique, and if you use it a lot I suggest you create a shell alias to something shorter.

Why did I create this?

Social

Help others discover gitopolis:

Twitter

Tweet about gitopolis

Product Hunt

Vote for gitopolis:

Gitopolis - Manage multiple git repositories with ease. | Product Hunt

Contributing

Suggestions welcome, particularly adding your experience, problems and ideas to the issues list.

I'm happy for people to open issues that are actually just questions and support queries.

Rough internal design and ambitions can be found at Design.md.

PRs are appreciated but bear in mind I have my own plans and this is a side project for me to learn rust in a useful way, so worth talking to me before investing too much time in anything that might not fit yet. I hope to make this smoother with better CI tests etc. Start by opening an issue with your thoughts, or ping me some other way (I'm easy to find for better or worse).

Builds