diff options
Diffstat (limited to 'content/post/self-hosted-git.md')
-rw-r--r-- | content/post/self-hosted-git.md | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/content/post/self-hosted-git.md b/content/post/self-hosted-git.md index c73d255..883ea0f 100644 --- a/content/post/self-hosted-git.md +++ b/content/post/self-hosted-git.md | |||
@@ -62,22 +62,22 @@ means that I can create a remote repository automatically by cloning a | |||
62 | repository URL that doesn't already exist. | 62 | repository URL that doesn't already exist. |
63 | I can clone and create a new repo simultaneously like so: | 63 | I can clone and create a new repo simultaneously like so: |
64 | 64 | ||
65 | {{< highlight shell-session >}} | 65 | ```shell |
66 | cd ~/projects | 66 | cd ~/projects |
67 | git clone alanpearce.eu:some-new-repository | 67 | git clone alanpearce.eu:some-new-repository |
68 | {{< /highlight >}} | 68 | ``` |
69 | 69 | ||
70 | But with [ghq][], which I [blogged about before][using-ghq], I don't | 70 | But with [ghq][], which I [blogged about before][using-ghq], I don't |
71 | have to concern myself with where to put the repository: | 71 | have to concern myself with where to put the repository: |
72 | 72 | ||
73 | {{< highlight shell-session >}} | 73 | ```shell |
74 | $ ghq get alanpearce.eu:some-new-repository | 74 | $ ghq get alanpearce.eu:some-new-repository |
75 | clone ssh://alanpearce.eu/some-new-repository -> /Volumes/Code/projects/alanpearce.eu/some-new-repository | 75 | clone ssh://alanpearce.eu/some-new-repository -> /Volumes/Code/projects/alanpearce.eu/some-new-repository |
76 | git clone ssh://alanpearce.eu/some-new-repository /Volumes/Code/projects/alanpearce.eu/some-new-repository | 76 | git clone ssh://alanpearce.eu/some-new-repository /Volumes/Code/projects/alanpearce.eu/some-new-repository |
77 | Cloning into '/Volumes/Code/projects/alanpearce.eu/some-new-repository'... | 77 | Cloning into '/Volumes/Code/projects/alanpearce.eu/some-new-repository'... |
78 | Initialized empty Git repository in /var/lib/gitolite/repositories/some-new-repository.git/ | 78 | Initialized empty Git repository in /var/lib/gitolite/repositories/some-new-repository.git/ |
79 | warning: You appear to have cloned an empty repository. | 79 | warning: You appear to have cloned an empty repository. |
80 | {{< /highlight >}} | 80 | ``` |
81 | 81 | ||
82 | The nice URLs come from this piece of my SSH configuration: | 82 | The nice URLs come from this piece of my SSH configuration: |
83 | 83 | ||
@@ -92,10 +92,10 @@ Host alanpearce.eu | |||
92 | This repository would be private by default, but I can change that by an | 92 | This repository would be private by default, but I can change that by an |
93 | SSH command. Here's how I would do it: | 93 | SSH command. Here's how I would do it: |
94 | 94 | ||
95 | {{< highlight shell-session >}} | 95 | ```shell |
96 | $ ssh alanpearce.eu perms some-new-repository + READERS gitweb | 96 | ssh alanpearce.eu perms some-new-repository + READERS gitweb |
97 | $ ssh alanpearce.eu perms some-new-repository + READERS daemon | 97 | ssh alanpearce.eu perms some-new-repository + READERS daemon |
98 | {{< /highlight >}} | 98 | ``` |
99 | 99 | ||
100 | The first command makes it visible in cgit, whilst the second makes it | 100 | The first command makes it visible in cgit, whilst the second makes it |
101 | clonable via `git://` url. I can make a repository | 101 | clonable via `git://` url. I can make a repository |
@@ -105,15 +105,14 @@ user and not `gitweb`, if I wanted. | |||
105 | I can also add or change the description of a repository shown on cgit like | 105 | I can also add or change the description of a repository shown on cgit like |
106 | so: | 106 | so: |
107 | 107 | ||
108 | {{< highlight shell-session >}} | 108 | ```shell |
109 | $ ssh alanpearce.eu desc some-new-repository 'A new repository' | 109 | ssh alanpearce.eu desc some-new-repository 'A new repository' |
110 | {{< /highlight >}} | 110 | ``` |
111 | 111 | ||
112 | All the remote commands exposed by gitolite are described in the | 112 | All the remote commands exposed by gitolite are described in the |
113 | `help` command | 113 | `help` command e.g. `ssh alanpearce.eu help` |
114 | 114 | ||
115 | {{< highlight shell-session >}} | 115 | ``` |
116 | $ ssh alanpearce.eu help | ||
117 | hello alan, this is gitolite@oak running gitolite3 (unknown) on git 2.12.2 | 116 | hello alan, this is gitolite@oak running gitolite3 (unknown) on git 2.12.2 |
118 | 117 | ||
119 | list of remote commands available: | 118 | list of remote commands available: |
@@ -126,7 +125,7 @@ list of remote commands available: | |||
126 | perms | 125 | perms |
127 | writable | 126 | writable |
128 | 127 | ||
129 | {{< /highlight >}} | 128 | ``` |
130 | 129 | ||
131 | ## Conclusion | 130 | ## Conclusion |
132 | 131 | ||