Tool to help working with multiple git repositories (short for Multiple Repositories).
See: http://fabioz.github.io/mu-repo/ for more details
Tool to help in dealing with multiple git repositories
Home Page: http://fabioz.github.io/mu-repo/
License: Other
Tool to help working with multiple git repositories (short for Multiple Repositories).
See: http://fabioz.github.io/mu-repo/ for more details
How do I show colours when using this.
Especially when using mu diff
mu checkout master failed for me with the following:
cl-tools : git checkout master
error: pathspec '"\033[32mmaster\033[m"' did not match any file(s) known to git.
until I turned color.ui to "auto". This is more of a tip since the workaround is the default behavior, thanks for the cool code!
With Python 3.9, deprecated isAlive method was removed.
This is still used in execute_git_command_in_thread.py line 214.
It would be very useful to have a way to create github/bitbucket pull requests on all the projects automatically
It would be nice if the set of repositories could be filtered based on some dynamic properties. For example:
It would be a kind of dynamic grouping function.
First of all, great thanks for your providing this nice tool.
Thanks to mu-repo, now I can better manage multiple git repositories in a more systematic way.
The git command 'gc', however, seems to have no effects when running it by "mu gc" as shown below:
> mu gc
Bin : git gc
Learning : git gc
Research : git gc
dotFiles : git gc
elisp : git gc
Running 'gc' through git aliases throught the stackoverflow solution suggested by Jose Luis Blanco, however, result in the following:
> git all gc
Bin/.git
Counting objects: 65, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (47/47), done.
Writing objects: 100% (65/65), done.
Total 65 (delta 5), reused 65 (delta 5)
Learning/.git
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), done.
Total 6 (delta 0), reused 6 (delta 0)
...
Note that other git commands show the resulting messages unlike the 'gc'.
I love it!
Thank you for making this awesome tool! ๐
So f.ex. today, we can do: mu st repo:repo1,repo2
.. But we cannot add repo1, repo2
to a group x
, and then do mu st repo:x
.
I suggest that the repo:
filter should first check for repositories by name, and if they don't exist, check for groups of the same name. If not already the case, groups should not be allowed to be named the same as repositories.
This will also allow me to do: mu st repo:x,other-repo
to target repo1, repo2 and other-repo
.
Note: Github is having issues today, so I may have double-posted this as #44. If that's the case, close this one.
Is it possible to preserve the colors that git outputs on it's own? It definitely makes a big difference when reading through the output when managing numerous repos.
I have this git alias:
git u == git pull --rebase --autostash
but running mu u
gives:
Not enough arguments passed
Am I doing something wrong or does support for aliases need to be added?
So f.ex. today, we can do: mu st repo:repo1,repo2
.. But we cannot add repo1, repo2
to a group x
, and then do mu st repo:x
.
I suggest that the repo:
filter should first check for repositories by name, and if they don't exist, check for groups of the same name. If not already the case, groups should not be allowed to be named the same as repositories.
This will also allow me to do: mu st repo:x,other-repo
to target repo1, repo2 and other-repo
.
I'd like a way to know, if any of my repos are ahead or behind their corresponding remotes. If possible, I'd also like to know this for any other branches I may have.
I do not know the relevant git commands, apart from the fact that git status
will tell me if I'm behind or ahead...
I usually run mu status
and then read through the messages, but it's quite cumbersome..
The latest version on PyPI does not work on Python 3 (a problem that is already fixed in master
).
I run mu on two systems - my linux machine works fine, but my macbook does not.
ben@Benjamins-MacBook-Pro [16:28:01] [~/dev/sabstt/enterprise]
-> % mu --version
mu-repo version 1.8.1
When I run a custom sh command it looks like mu is trying to run it via git instead:
ben@Benjamins-MacBook-Pro [16:32:00] [~/dev/sabstt/enterprise]
-> % mu sh npm i
admin-api : git i
So obviously this fails... the strange thing is this works fine on my aforementioned linux box:
enterprise|โ mu sh npm i
admin-api : npm i
That too is running 1.8.1.
Not an issue of a bug report, but a big thank you for a great project!
The only one of this kind that I found that works properly on windows! ๐ฅ
The only tiny feature suggestion: custom aliases maybe?
Thanks again!
Neither mu register --all
or --recursive
seemed to work on OSX. Both gave me empty results for mu list
.
I didnt see any errors and so instead just used ls -d */ | xargs -I {} mu register {}
instead.
mu
itself seems to be working great though! Thanks so much for making it
Hi,
I just noticed that mu register --all
only registers propjects within the current directory. Is it also possible to register all projects recursively? Manually registering them works as expected: mu register mygroup/myproject1 mygroup/myproject2
yields:
repo=mygroup/myproject1
repo=mygroup/myproject2
serial=False%
Thx for this fine project!
Was attempting to do a diff for a sub-repo from the top directory:
mu diff repo:media_server_config
But "diff" was run on all of the repo's registered/tracked.
Cloning using mu
, against Gitlab, will work for https://xyz.com/Group/Repo
, but will break future mu
features like grouping, because Gitlab redirects to https://xyz.com/Group/Repo.git/
.
I mentioned this in #42, but didn't create an issue on it. The issue is that for Gitlab.com, you can use both a non .git
address, and a .git
address to clone/work with, with Gitlab redirecting you to the .git
version always.
This shows up in git cli with a warning: redirecting to https://xyz.com/Group/Repo.git/
. The solution is to not have a redirect, as in cloning with the .git/
end. It will directly affect mu
, in that all mu
actions (st
, up
etc.), in that mu
can't group the results.
I don't know how to fix this. I can think of the following:
REPO/info/refs
, and follow any redirect till the end. Then use the final address as a cloning url.mu
can group correctly againI want to pip install mu
:-)
mu checkout used to work even with partial branch names.
In the current version, if the user doesn't give the branch full name, the following exception occurs:
File "W:\Miniconda\lib\site-packages\mu_repo\action_checkout.py", line 27, in Run
branch, _repo = iteritems(branch_to_repos).next()
AttributeError: 'dict_items' object has no attribute 'next'
mu installed via pip command..never worked
Traceback (most recent call last):
File "/usr/local/bin/mu", line 9, in <module>
load_entry_point('mu-repo==1.3.0', 'console_scripts', 'mu')()
File "/usr/local/lib/python2.7/dist-packages/mu_repo/__init__.py", line 312, in main_entry_point
main()
File "/usr/local/lib/python2.7/dist-packages/mu_repo/__init__.py", line 301, in main
return Run(Params(config, args, config_file))
File "/usr/local/lib/python2.7/dist-packages/mu_repo/action_register.py", line 66, in Run
with open(config_file, 'w') as f:
TypeError: coercing to Unicode: need string or buffer, NoneType found
Thanks!
Hi Dude,
Many thanks for the great tool!
Some time, the repo is in deep directory and I wanted to maintian the .mu_repo globally.
repo=/mnt/d/projects/working/someapp/RCN-918/app-config
This absolute path is too long to be put in group config
Is it possible to support a short name for the repo as follows:
repo=/mnt/d/projects/working/someapp/RCN-918/app-config, someapp-app-conf
So I can use someapp-app-conf in group config
Have a nice day!
You can see the issue below.
% mu register test
Repository: test registered
Traceback (most recent call last):
File "/home/emp/src/mu-repo/mu", line 4, in <module>
mu_repo.main()
File "/home/emp/src/mu-repo/mu_repo/__init__.py", line 243, in main
return Run(Params(config, args, config_file))
File "/home/emp/src/mu-repo/mu_repo/action_register.py", line 50, in Run
f.write(str(config))
File "/home/emp/src/mu-repo/mu_repo/config.py", line 129, in __str__
for group_name, repos in sorted(val.iteritems()):
AttributeError: 'dict' object has no attribute 'iteritems'
I like the mu clone
workflow, so I checked this .mu_repo file into my "main" repo:
repo=.
repo=..\depA
serial=True
After I cloned the the "main" repo and its dependencies into a root folder, I still want to be able to use mu (e.g. mu rb
). When I'm outside the main repo (e.g. in root or depA) mu can't see any .mu_repo file and will no longer work.
Should I maintain a separate .mu_repo file in my root folder?
Here's how to reproduce:
C:\Temp> mkdir mutest
C:\Temp> cd mutest\
C:\Temp\mutest> echo a > a
C:\Temp\mutest> git init
Initialized empty Git repository in C:/Temp/mutest/.git/
C:\Temp\mutest (master)> git add a
C:\Temp\mutest (master)> git commit -m "a"
[master (root-commit) 6b01352] a
1 file changed, 1 insertion(+)
create mode 100644 a
C:\Temp\mutest (master)> git checkout -b ab
Switched to a new branch 'ab'
C:\Temp\mutest (ab)> git checkout -b abcd
Switched to a new branch 'abcd'
C:\Temp\mutest (abcd)> git branch
ab
* abcd
master
C:\Temp\mutest (abcd)> mu checkout abc
Traceback (most recent call last):
File "C:\Miniconda\Scripts\mu-script.py", line 5, in <module>
sys.exit(mu_repo.main_entry_point())
File "C:\Miniconda\lib\site-packages\mu_repo\__init__.py", line 348, in main_entry_point
main()
File "C:\Miniconda\lib\site-packages\mu_repo\__init__.py", line 337, in main
return Run(Params(config, args, config_file))
File "C:\Miniconda\lib\site-packages\mu_repo\action_checkout.py", line 27, in Run
branch, _repo = iteritems(branch_to_repos).next()
AttributeError: 'dict_items' object has no attribute 'next'
I think the problem is with this code (iteritems(branch_to_repos).next()
), that fails in Python 3. In Python 3, changing it to next(iter(iteritems(branch_to_repos)))
makes it work, but then next
would probably have to be added to backwards
.
When locally someone has a branch like rb-rfdap_workbench-v0.10.1 and a checkout is wanted on rb-rfdap_workbench-v0.10, then the following error occurs. There is a workaround which is to delete locally the branch which has the other name in composition.
rfdap โ mu branch
. : git branch
master
rb-rfdap_workbench-v0.10.1
rfdap โ mu co rb-rfdap_workbench-v0.10
File "/home/rosenbach/Work/miniconda/lib/python3.6/site-packages/mu_repo/action_checkout.py", line 27, in Run
branch, _repo = iteritems(branch_to_repos).next()
AttributeError: 'dict_items' object has no attribute 'next'
Since our git repositories are big, I would like to use git shallow-clone to only clone one branch(refer to link) to save my disk space.
I want to clone all repositories in the group, by using command like this:
mu clone -all -b release/1.21 --single-branch
Could it be supported?
Hi,
I have a problem when using mu repo together with git credential manager for Windows.
When I do 'mu fetch' i get spammed with credential manager windows.
Does anyone have a solution/work-around for my problem or is this a dead end?
When calling mu register --recursive
symlinks are followed. That is ok afaic. The problem is, that now the linked repository is listed two times. Once under its original path and once under the symlink.
For example:
projects/
proj1/
node_modules/
proj3 โ ../../proj3
proj2/
proj3/
The above structure will we detected as .mu_repo
:
repo=proj1
repo=proj1/node_modules/proj3
repo=proj2
repo=proj3
Hi,
If I wanted to run some commands to build the repos like "mvn clean install", how would I do it with this tool?
-Keith
See https://travis-ci.org/fabioz/mu-repo.
I think this causes installation via pip to fail.
A new command named switch
that lists branches common to all registered repositories and lets him to switch all at the same time.
The branches would be indexed, allowing the user to just type the index instead of having to type a full branch name. For example:
]mu switch
Common branches:
[1] fb-SSRL-2.9
[2] master
[3] stable-12.0-master
Switch to which branch? 1
In the example above, the user selected 1
which in turn checked out branch fb-SSRL-2.9
for all registered repositories.
Also, an option --all
should be added to also list common remote branches besides local ones.
I have a lot repositories with .git file that has content like:
gitdir: /home/user/foo/bar/repo1
When trying to run mu register --all
mu-repo does not treat such directories as a git repository
When running a command like mu status --porcelain
or a more low-level equivalent for checking for changes such as mu diff-index HEAD --
, the output for each command being run makes it inconvenient to use the output of these commands conveniently. Can a parameter or toggle be added to use mu "quietly" so that commands can more easily be run where the mu-specific output is not needed or where the only thing we care about is that there is output, not which repo it comes from?
Symptom is all repos give me a usage message as if my arguments were wrong:
mu-repo : git status
usage: git [--version] [--help] [-C <path>] [-c name=value]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
<command> [<args>]
I reverted to commit d9f8bf3 and everything works.
It'd be really nice if I could do
mu clone <repo> <folder>
and it cloned and registered each repo. And then after checking out a repo with a .mu-repo
mu clone
which would pull all repos down.
How do I un/de register a git repo that I don't want to pull from anymore?
Hey,
I'm trying to clone a repo using this guide. I've set up my remotes without any user or group names in them (ie. https://user@host/
), expecting to be able to clone a/b
to effectively get https://user@host/a/b.git
-- but this doesn't work.
$ mu clone A/B
. : git config --get-regexp mu-repo.remote-base-url
Unable to clone because the repository name for cloning with mu was not detected.
If I clone something without slashes, it shows the paths it tries (which would be correct, if I had a project with that name :P).
Could slashes in repo names be allowed? :)
In my use case the number of repos in a directory can change over time.
Therefore I need to register them before any mu
operation.
A nice solution for that would by a dynamic detection of all repos in certain directory.
For example in the .mu_repo
file by adding property like this:
repo=directory\*
Would cause mu-repo
first to detect all repositories in the indicated directory, and than execute git
operation on it.
When working with more than one remote, it's useful to name the remote according to e.g. the service it came from:
git clone --origin github https://[email protected]/fabioz/mu-repo
or
git clone --origin home-nas git://home-nas/mu-repo
etc
mu-repo
currently assumes that a remote is named 'origin'. When it isn't, many commands fail.
$ pip install mu-repo
Collecting mu-repo
Using cached mu_repo-1.6.0.tar.gz
Installing collected packages: mu-repo
Running setup.py install for mu-repo ... done
Successfully installed mu-repo-1.6.0
$ mu
-bash: /Users/swivelgames/Library/Python/2.7/bin/mu: No such file or directory
The following breaks due to mu
not honoring quotes in arguments
$ mu log --after="2016-09-07 19:30 CDT" --before="2016-09-07 19:00 CDT"
repo1 : git log --after=2016-09-07 19:30 CDT --before=2016-09-07 19:00 CDT
...
I am not able to find a way to clone all repo's in a group, created multiple groups and register repo's but can't seem to clone them. Can you kindly suggest how I can clone all repo's in a group.
the mu p
shortcut conflicts with a shortcut that exists in my git config. Thus, running mu p
takes a different action than git p
. That is unexpected behavior and quite jarring.
I think overriding user-set configuration from git is not appropriate when you explicitly support the behavior.
Is it possible to set a config to first honor git config shortcuts before using the mu shortcuts?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.