March 21, 2016

Git on Site5

I've been running subversion as my version control - backed up to my site5 account - for most of a decade. But it really is time to change that, and I don't feel like putting everything on github, just because github exists, so I had to figure out git on Site5 - if there's git on your shared hosting it probably works there too. I'm assuming you have ssh access using something like 'ssh username@domain'

On the server:

mkdir directory_where_i_want_to_create_all_my_git_repos
cd directory_where_i_want_to_create_all_my_git_repos
git init --bare mynewrepo.git

A bare repo is all the versioning and metadata, but without a local working copy. Git won't let you push to a remote that's actually a working copy

Locally, everything happens in the project directory you want under version control

cd mynewrepo
git init
git remote add site5 username@domain:/home/username/directory_where_i_want_to_create_all_my_git_repos/mynewrepo.git
git add .
git commit -a -m "first commit"
git push site5 master

- so apart from getting the ssh-auth + file location invocation right, when adding the remote, the only trick you need to know is that bare repos are different from working copies...

Posted by Claus at March 21, 2016 5:07 PM
Post a comment