From 89c47b9236bbb7b05f9d24fbe2ad9d3239082429 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 30 Jun 2021 17:15:38 -0400 Subject: git tweaks --- git.html | 65 ++++++++++++++++++++++++++++++-------------------------------- index.html | 4 ++-- 2 files changed, 33 insertions(+), 36 deletions(-) diff --git a/git.html b/git.html index bfeb086..ad0fbae 100644 --- a/git.html +++ b/git.html @@ -9,45 +9,34 @@ -

Hosting Your Own Git Repositories

+

Hosting Your Own Git Repositories

Once you have your own VPS or other Internet-available server, you can start hosting your own git repositories. The goal of this tutorial is - for you to go from + for you to go from

git clone github.com/...
- to +

to

git clone YourLandChadDomainName.xyz/...
- so you can cultivate your own homegrown, grass fed code, rather than +

+ so you can cultivate your own homegrown, grass-fed code, rather than relying on a centralized proprietary service like GitHub.

-

What's not included in this tutorial

- - -

Installing git

You most likely already have it installed on your server, but if not, - run + run:

apt install git
+

We don't need any additional software, git itself ships with everything needed to host a remote repository!

@@ -75,24 +64,27 @@

If you're logged in to your server as root and have git installed, you can become the git user by executing +

su git
+

Now navigate to/create your desired directory, for example +

-

-cd /srv
-mkdir git
-        
+
cd /srv
+mkdir git

Create the repo

Now you can create the bare repository with +

git init --bare my-repo.git
+

By convention, bare repository names end with ".git".

@@ -107,12 +99,12 @@ mkdir git

You will need to be able to login remotely via ssh as the git user we've used before. To do this, you will either - need to set up a password for the git user with - -

passwd git
- + need to set up a password for the git user by running + passwd git, or copy your public SSH key from your local machine to /home/git/.ssh/authorized_keys. + See the SSH keys instructional for details + (just log in as git instead of root).

Syncing a new repository with your server

@@ -127,7 +119,8 @@ mkdir git

A remote is just a named URL remembered in your repo's configuration. So we need a name and a URL. By convention, the "main" remote is called - "origin". The URL has the format user@host:path, where + "origin". The URL has the format user@host:path, where: +