{{ define "styles" }} {{ end }} {{ define "content" }}

git

My git repositories are hosted on a VPS and use legit for the web frontend.

Pushing using HTTP/S is disabled, pushing must be done over SSH.

Creating a new repo

First, a new bare repo needs to be created on the server. In my case, all git repos are stored on the server in /var/git:

cd /var/git
mkdir my-new-repo
cd my-new-repo
git init --bare

Once the bare repo on the server has been created, switch to a client and create a new working (non-bare) repo:

mkdir my-new-repo
cd my-new-repo
git init

With this, the working repo has been created on the client, now we can add content and commit it:

** Add/change some stuff, make a readme... **
git add .
git commit -m "initial commit"

Now we need to do the inital push and update the remote for the repo to be the server repo (you need to have already set up SSH for the remote user that you are using to do the push):

git remote add origin <REMOTE_USER>@git.deserthorns.net:/var/git/my-new-repo
git push --set-upstream origin master

Now our repo on the server should have the files added/changed by the client.

After the initial commit, pushing is easy as:

** Add/change some stuff **
git add .
git commit -m "did stuff"
git push

Cloning over SSH

You need to have already set up SSH for the remote user that you are using to clone!

git clone <REMOTE_USER>@git.deserthorns.net:/var/git/my-repo
{{ end }} {{ define "scripts" }} {{ end }}