A cross-patform tool for managing & syncing multiple git repositories while simultaneously keeping them arranged in a user defined directory hierarchy.
I have a few private repositories where I keep some code snippets as well as some project repositories I often look for while coding.Therefore I need to clone them on every laptop/pc I work on.To achieve this I had to clone and sync up each individual repo on each individual machine whenever some update was there to one or more repos. When looking at the tools, I found the tool repo
by google which unfortunately was not natively supported for Windows. Thus, I started this little python script for the same, which turned out to be quite helpful, I made it a little more user friendly and released it as a mini project.
Python 3.6+
-
git clone https://github.com/abhishekr700/repo-manager
-
cd repo-manager
-
pip install -r requirements.txt
-
Edit the JSON file according to the format shown below
-
Windows
Clone this repository and use it like
python3 repomgr.py [args]
Linux (Tested on Ubuntu)
./install_linux.sh
- You need to first initialize your Workspace by running
repomgr setup /pat/to/jsonfile
- After this your workspace will be set up.
- Go into the workspace and try the commands shown below.
Usage: python test.py setup | list | status | sync | cnc
setup - Setups the workspace using the JSON file
list - List the repositories managed by this tool
status - Check for uncommited work in the repositories
sync - Goto each repository and do a git pull followed by a git push
cnc - Clean & re-clone all repositories
help - Print this help
The whole file is a JSON Object.
-
savedCreds: '0' if you want to specify credentials everytime you run the script. '1' if you want to save the credentials. if '1', you need to specify the key 'credentials'
-
credentials: Git Credentials to use
- credentials.username: Github Username
- credentials.password: Github Password
-
data: An array of Objects, each one specifying a repository
-
Repository Format
{ "name": "OnlineAuction", //Name of repository "type": "public", // private or public "path": "01WebProjects" // Location to clone to }
-
For more clarity regarding this file, check
sample.json
file
Windows
./tests/windows.cmd
Linux
./tests/linux.sh
👤 Abhishek Ranjan
- Github: @abhishekr700
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2020 Abhishek Ranjan.
This project is GNU GPL V3.0 licensed.