fabioz / mu-repo

Tool to help in dealing with multiple git repositories
http://fabioz.github.io/mu-repo/
Other
295 stars 37 forks source link

Add 'git worktree add' custom support for mu-repo #58

Closed slaingod closed 4 years ago

slaingod commented 4 years ago

'mu worktree add...' does not produce usable results, this PR improves that behavior by using the repo relative path from the config to regenerate the repo structure in the worktree destination, as well as copying the .murepo to the new worktree so mu repo commands work as expected.

mu worktreeadd will create a mu-repo copy of the currently active repo group in a subfolder of the current folder called _wt/

mu wtadd #wtadd is a shortcut name will create a mu-repo copy of the currently active repo group in a subfolder of the specified folder called

git worktrees are great for having multiple copies of repos (always have a develop, master, release, and any number of feature branches for instance) as shallow copies with shared stashes.

Feel free to provide feedback or to take this PR and rework it as needed.

slaingod commented 4 years ago

Actually discovered a nuance with git worktree add where it can have a -b arg to create a new branch. Going to rework this change to allow for that.