summaryrefslogtreecommitdiffstats
path: root/content/post/self-hosted-git.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/post/self-hosted-git.md')
-rw-r--r--content/post/self-hosted-git.md29
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
62repository URL that doesn't already exist. 62repository URL that doesn't already exist.
63I can clone and create a new repo simultaneously like so: 63I can clone and create a new repo simultaneously like so:
64 64
65{{< highlight shell-session >}} 65```shell
66cd ~/projects 66cd ~/projects
67git clone alanpearce.eu:some-new-repository 67git clone alanpearce.eu:some-new-repository
68{{< /highlight >}} 68```
69 69
70But with [ghq][], which I [blogged about before][using-ghq], I don't 70But with [ghq][], which I [blogged about before][using-ghq], I don't
71have to concern myself with where to put the repository: 71have 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
77Cloning into '/Volumes/Code/projects/alanpearce.eu/some-new-repository'... 77Cloning into '/Volumes/Code/projects/alanpearce.eu/some-new-repository'...
78Initialized empty Git repository in /var/lib/gitolite/repositories/some-new-repository.git/ 78Initialized empty Git repository in /var/lib/gitolite/repositories/some-new-repository.git/
79warning: You appear to have cloned an empty repository. 79warning: You appear to have cloned an empty repository.
80{{< /highlight >}} 80```
81 81
82The nice URLs come from this piece of my SSH configuration: 82The nice URLs come from this piece of my SSH configuration:
83 83
@@ -92,10 +92,10 @@ Host alanpearce.eu
92This repository would be private by default, but I can change that by an 92This repository would be private by default, but I can change that by an
93SSH command. Here's how I would do it: 93SSH 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 96ssh alanpearce.eu perms some-new-repository + READERS gitweb
97$ ssh alanpearce.eu perms some-new-repository + READERS daemon 97ssh alanpearce.eu perms some-new-repository + READERS daemon
98{{< /highlight >}} 98```
99 99
100The first command makes it visible in cgit, whilst the second makes it 100The first command makes it visible in cgit, whilst the second makes it
101clonable via `git://` url. I can make a repository 101clonable via `git://` url. I can make a repository
@@ -105,15 +105,14 @@ user and not `gitweb`, if I wanted.
105I can also add or change the description of a repository shown on cgit like 105I can also add or change the description of a repository shown on cgit like
106so: 106so:
107 107
108{{< highlight shell-session >}} 108```shell
109$ ssh alanpearce.eu desc some-new-repository 'A new repository' 109ssh alanpearce.eu desc some-new-repository 'A new repository'
110{{< /highlight >}} 110```
111 111
112All the remote commands exposed by gitolite are described in the 112All 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
117hello alan, this is gitolite@oak running gitolite3 (unknown) on git 2.12.2 116hello alan, this is gitolite@oak running gitolite3 (unknown) on git 2.12.2
118 117
119list of remote commands available: 118list 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