README (3706B)


     1 git repo manager~
     2 =================
     3 
     4 +------v
     5 | NOTE
     6 +-------
     7 | This is the tilde edition of git repo manager. If you want to host git
     8 | repositories on your own server, see the master branch [1].
     9 +------^
    10 
    11 grm is a minimal, POSIX-compliant shell script for managing git repositories on
    12 self-hosted git servers. The *tilde edition* of grm is a fork specially
    13 designed for the users of pubnix/tildes servers [2]. It is intended to be used
    14 with stagit [3] to generate a static web interface for the repos, but you don't
    15 necessarily need it for this script to work.
    16 
    17 Installation
    18 ------------
    19 
    20 Either clone this repository, or use curl/wget to download the latest version
    21 from the url below to your ~/bin.
    22 
    23   $ curl -o ~/bin/grm https://tilde.team/~kst/bin/grm
    24   $ chmod +x ~/bin/grm
    25 
    26 If you want to have a web interface for your repositories, you should also have
    27 stagit [3] compiled and installed to your ~/bin.
    28 
    29 Then, edit the script to fill in some configurations,
    30 
    31   # root directory of git repositories
    32   GRM_REPOS_ROOT="$HOME/public_html"
    33 
    34   # default url prefix (without ending slash)
    35   GRM_URL_PREFIX="https://tilde.team/~$USER"
    36 
    37   # path of the post-receive hooks for stagit
    38   GRM_POSTRECV_HOOK="$HOME/bin/stagit-post-receive"
    39 
    40   # root directory of stagit web pages
    41   STAGIT_WEB_ROOT="$HOME/public_html/git"
    42 
    43 An example of the post-receive hook for stagit can be found here [4]. Note that
    44 the hook itself needs some further configuration.
    45 
    46 For the default settings, your home directory will have the following structure
    47 
    48 ~
    49 ├── bin
    50 │   ├── grm
    51 │   ├── stagit
    52 │   ├── stagit-index
    53 │   ├── stagit-post-receive
    54 │   └── ...
    55 ├── public_html
    56 │   ├── git                  <-- your stagit root directory
    57 │   │   ├── index.html
    58 │   │   └── ...
    59 │   ├── public-repo.git
    60 │   │   ├── branches
    61 │   │   ├── head
    62 │   │   └── ...
    63 │   └── unlisted-repo.git    <-- won't appear on the index page of stagit
    64 │       ├── branches
    65 │       ├── HEAD
    66 │       ├── ...
    67 │       └── stagit-no-index
    68 └── ...
    69 
    70 Usage
    71 -----
    72 
    73 $ grm help
    74 usage: grm <command> [<args>]
    75 
    76 git repo manager, tilde edition
    77 
    78 commands:
    79     new                  create a new repo
    80     info repo_name       display metadata of the repo
    81     ls                   list all repos
    82     rm repo1 [repo2..]   remove repos
    83     rc                   recompile stagit index
    84     rc repo1 [repo2..]   recompile stagit pages for repos,
    85                          and recompile index
    86     rca                  recompile all repos
    87     help                 show help
    88 
    89 Examples
    90 --------
    91 
    92 $ grm new
    93 repo name
    94 > grmr
    95 no index? [y/N]
    96 > n
    97 description [a work in progress]
    98 > grm redux
    99 owner [username]
   100 >
   101 clone url [https://tilde.team/~username/grmr.git]
   102 >
   103 Initialized empty Git repository in /home/username/public_html/grmr.git/
   104 writing stagit metadata...
   105 installing stagit post-receive hook...
   106 installing post-update hook for updating server info...
   107 updating server info for the first time...
   108 done!
   109 
   110 $ grm ls
   111 grm
   112 grmr
   113 $ grm info grmr
   114 name: grmr
   115 indexed: yes
   116 description: grm redux
   117 owner: username
   118 url: https://tilde.team/~username/grmr.git
   119 
   120 $ grm rc grmr
   121 [grmr] recompiling stagit pages...
   122 [index] rebuilding index...
   123 [grmr] done!
   124 [index] done!
   125 recompilation done!
   126 
   127 $ grm rm grmr
   128 remove grmr? [y/N] y
   129 [index] rebuilding index...
   130 [index] done!
   131 
   132 $ grm ls
   133 grm
   134 
   135 License
   136 -------
   137 
   138 grm is licensed under the MIT license.
   139 
   140 [1]: https://sink.krj.st/grm/
   141 [2]: https://tilde.wiki/other-tildes
   142 [3]: https://codemadness.org/git/stagit/
   143 [4]: https://tilde.team/~kst/git/stagit-postrecv/file/stagit-post-receive.html