move your local repository into ghq's root directory with suitable URI-based path.
- bash
- sed (may not work with GNU's version. Only tested with the BSD version)
- git
And you need to set ghq's root directory configuration in 'git-config'. If you already started using ghq, you need to do nothing about it. Read ghq's README.
$ ghq-migrator.bash ./(YOUR_REPOSITORY)/
You can customize behavior of ghq-migrator by following environmental variables.
Unless this variable set to 1
, ghq-migrator doesn't move repository's directory (dry-run).
It's recommended to run ghq-migrator without this option at first, check output, and run with GHQ_MIGRATOR_ACTUALLY_RUN=1
to move directory actually.
By default, ghq-migrator doesn't move a repository with more than two git-remote url.
If GHQ_MIGRATOR_PREFER_ORIGIN=1
is set, ghq-migrator moves the repository according to url of origin
even it has another remote.
Note : Even if GHQ_MIGRATOR_PREFER_ORIGIN=1
is specified, ghq-migrator cannot move repositories which its origin has more than 2 urls, because ghq-migrator cannot decide which url to use.
If GHQ_MIGRATOR_LINK=1
is set, a symbolic link to the destination directory will be created at the place where the repository was moved from.
astj (asato.wakisaka@gmail.com)
MIT