We have 10+ repos under ~/ and it is a real PITA to push all changes manually to our different remote repositories (some on Bitbucket, others on Github).
There is a great tool called MyRepos written by Debian Developer Joey Hess (well-known for debian-installer, debhelper, git-annex and lots of other popular packages) that allows you to manage multiple VCS repositories with a single command.
To setup mr to work with your repo, first you have to cd into the directory containing your repo and type:
mr register
so myrepos can make a note of the remote repo target.
Once that's done for all the repos you want to manage with mr, exit out of the directories under version control and run your VCS command prefaced by mr to update multiple repos at once. Here's an example of pushing local changes to 7 different remote git repositories:
[archjun@arch ~]$ mr push -u origin master
mr push: /home/archjun/Documents/ MyProjects/KTokenizer
Password for 'https://gojun077@bitbucket. org':
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 475 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
3986b86..541569e master -> master
Branch master set up to track remote branch master from origin.
mr push: /home/archjun/Documents/ WhatYoureReallyMeantToDo
Password for 'https://gojun077@bitbucket. org':
Counting objects: 15, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (15/15), done.
Writing objects: 100% (15/15), 4.52 KiB | 0 bytes/s, done.
Total 15 (delta 6), reused 0 (delta 0)
89e72c6..a55889f master -> master
Branch master set up to track remote branch master from origin.
mr push: /home/archjun/Documents/ cchallenges
Password for 'https://gojun077@bitbucket. org':
Counting objects: 28, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (27/27), done.
Writing objects: 100% (28/28), 5.37 KiB | 0 bytes/s, done.
Total 28 (delta 10), reused 0 (delta 0)
3158800..d810c82 master -> master
Branch master set up to track remote branch master from origin.
mr push: /home/archjun/Documents/ coursera_IMT
Password for 'https://gojun077@bitbucket. org':
Counting objects: 6, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 953 bytes | 0 bytes/s, done.
Total 6 (delta 4), reused 0 (delta 0)
60e0628..987c4de master -> master
Branch master set up to track remote branch master from origin.
mr push: /home/archjun/Documents/cs50x_ 2014
Password for 'https://gojun077@bitbucket. org':
Counting objects: 44, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (42/42), done.
Writing objects: 100% (44/44), 4.75 KiB | 0 bytes/s, done.
Total 44 (delta 24), reused 0 (delta 0)
03f6060..9cf44c8 master -> master
Branch master set up to track remote branch master from origin.
mr push: /home/archjun/Documents/idb_ 2014
Password for 'https://gojun077@bitbucket. org':
Counting objects: 10, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 5.97 KiB | 0 bytes/s, done.
Total 10 (delta 5), reused 0 (delta 0)
212016d..bf033fc master -> master
Branch master set up to track remote branch master from origin.
mr push: /home/archjun/Documents/jun- project-euler
Username for 'https://github.com': gojun077
Password for 'https://gojun077@github.com':
Branch master set up to track remote branch master from origin.
Everything up-to-date
mr push: finished (7 ok)
A real time-saver!
댓글 없음:
댓글 쓰기