Skip to main content

A Git Project Manager

Project description

Metagit

Git for Git Repositories


If you:

  • have a directory full of Git repos
  • want to version-control the configuration of those repos
  • like Git

Then you might find Metagit useful. It offers a Git-like experience for managing Git repos.

Demo

Initialize a Metagit repository:

$ cd ~/projects/    # or wherever you store your Git projects, or use metagit -C
$ metagit init      # creates .metagit, a Git repo where tracked project configs are kept
Initialized Metagit repository in /home/dmtucker/projects
$ metagit status
Untracked projects
  (use "metagit add <project>..." to begin tracking)
	project1/
	project2/

Track changes to project config:

$ metagit add project1/ project2/    # start tracking some projects
$ git -C project1/ remote add foo git@somehost.com:foo/project1.git
$ rm -rf project2/
$ metagit status
Changes
  (use "metagit add/rm <project>..." to accept changes)
  (use "metagit restore <project>..." to undo changes)
	modified: project1
	deleted:  project2

Git tracks lines in files. Metagit tracks config in projects.

$ metagit diff
diff --git a/project1 b/project1
index 515f483..93a874c 100644
--- a/project1
+++ b/project1
@@ -3,3 +3,6 @@
 	filemode = true
 	bare = false
 	logallrefupdates = true
+[remote "foo"]
+	url = git@somehost.com:foo/project1.git
+	fetch = +refs/heads/*:refs/remotes/foo/*
diff --git a/project2 b/project2
deleted file mode 100644
index 515f483..0000000
--- a/project2
+++ /dev/null
@@ -1,5 +0,0 @@
-[core]
-	repositoryformatversion = 0
-	filemode = true
-	bare = false
-	logallrefupdates = true

This example deleted project2 so as to demonstrate metagit restore (below), but keep in mind, ONLY CONFIGURATION IS TRACKED. If you need all of project2 back, you should restore from a backup.

$ metagit restore project2  # only restores git config! not branches/tags/etc.
$ metagit add project1      # add the project again to keep the changes
$ metagit rm project1       # stop tracking a project (does not affect the actual project)

About .metagit

.metagit is just another Git repo in your projects folder. It is created by metagit init, which automatically starts tracking it. When metagit add is used to start tracking a project, that project's .git/config file is copied into .metagit and committed.

$ git -C .metagit log
36cec91 (HEAD -> master) Remove project1
a1ed312 Add project1
185ed15 Add project2
e4d274d Add project1
1e16b5e Add .metagit

Pro tip: Consider a clone of the .metagit repo a (Metagit) "clone" of your projects folder. For example, push the .metagit repo to GitHub to allow for easy provisioning of new dev machines:

$ mkdir ~/projects
$ cd ~/projects/
$ git clone git@github.com:dmtucker/.metagit.git
...
$ metagit restore project2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metagit-1.3.0.tar.gz (25.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metagit-1.3.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file metagit-1.3.0.tar.gz.

File metadata

  • Download URL: metagit-1.3.0.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/35.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.4

File hashes

Hashes for metagit-1.3.0.tar.gz
Algorithm Hash digest
SHA256 ffd444039b1d21c5e46463fb8c9085f1517e14a17cc71212e25f6aaae8265a49
MD5 dfa7df6148bfb7933b8a60bafa2ac745
BLAKE2b-256 466bcbd33b49842daed7dfbe6af536437ed4b6ff747b3fff17bf26b75b9b695b

See more details on using hashes here.

File details

Details for the file metagit-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: metagit-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/35.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.4

File hashes

Hashes for metagit-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66b7f12c424da652784bf4507966cfbf9b976f7afc32846dc5b8798f75dc4d37
MD5 bdefa29144da3b320f06e8b69e63ee07
BLAKE2b-256 de6791af44c9797b88b88391d94de8c55855bb9cf8d9854dd4bf193d4ebc0be1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page