|
1 | | - |
2 | | -# Contents |
3 | | - |
4 | | -* [github2mr](#github2mr) |
5 | | - * [Brief mr Example](#brief-mr-example) |
6 | | -* [Installation](#installation) |
7 | | -* [Configuration / Usage](#configuration--usage) |
8 | | - * [Other Git Hosts](#other-git-hosts) |
9 | | -* [Github Setup](#github-setup) |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | -# github2mr |
15 | | - |
16 | | -Many [Github](https://github.com/) users have a large number of repositories upon which they work, and managing them all can sometimes be difficult. |
17 | | - |
18 | | -One excellent tool which helps a lot is the [myrepos](https://myrepos.branchable.com/) package, containing a binary named `mr`, which allows you to run many operations upon multiple repositories with one command. (It understands git, mercurial, darcs, cvs, and many other types of revision-control systems.) |
19 | | - |
20 | | -This repository contains a simple command-line client which allows you to easily generate a configuration file containing __all__ your github repositories fetching them via the [Github API](https://developer.github.com/v3/) with various filtering and limiting options. |
21 | | - |
22 | | -The end result of using `mr` and `github2mr` is that you should be able to clone all your remote github repositories, and update them easily with only a couple of commands which is great for when you work/develop/live on multiple machines. |
23 | | - |
24 | | - |
25 | | -## Brief `mr` Example |
26 | | - |
27 | | -Let us pretend I'm moving to a new machine; first of all I export the list of all my remote repositories to a configuration file using _this_ tool: |
28 | | - |
29 | | - github2mr > ~/Repos/.mrconfig.github |
30 | | - |
31 | | -* **NOTE**: The first time you create a new configuration file you will need to mark it as being trusted, because it is possible for configuration files to contain arbitrary shell-commands. |
32 | | - * Mark the configuration file as trusted by adding it's name to `~/.mrtrust`: |
33 | | - * `echo ~/Repos/.mrconfig.github >> ~/.mrtrust` |
34 | | - |
35 | | -Now that we've populated a configuration-file we can tell `mr` to checkout each of those repositories: |
36 | | - |
37 | | - mr --jobs 8 --config ~/Repos/.mrconfig.github |
38 | | - |
39 | | -Later in the week I can update all the repositories which have been cloned, pulling in any remote changes that have been made from other systems: |
40 | | - |
41 | | - mr --jobs 8 --config ~/Repos/.mrconfig.github update |
42 | | - |
43 | | -**NOTE**: If you prefer you can just use `update` all the time, `mr` will checkout a repository if it is missing as part of the `update` process. I'm using distinct flags here for clarity. Please read the `mr`-manpage to look at the commands it understands. |
44 | | - |
45 | | - |
46 | | -# Installation |
47 | | - |
48 | | -You should be able to install this application using the standard golang approach. For `go>=1.13` go modules must be enabled: |
49 | | - |
50 | | - $ GO111MODULE=on go get github.com/skx/github2mr |
51 | | - |
52 | | -For earlier versions: |
53 | | - |
54 | | - $ go get github.com/skx/github2mr |
55 | | - |
56 | | -If you prefer you can [download the latest binary](http://github.com/skx/github2mr/releases) release, for various systems. |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | 1 | # Configuration / Usage |
62 | 2 |
|
63 | 3 | Once installed you'll need to configure your github token, which you can generate from [withing your github settings](https://github.com/settings/tokens). |
|
0 commit comments