gitb-init

create bare remote git repos
git clone git://git.ricketyspace.net/gitb-init.git
Log | Files | Refs

commit 17222d25eb8d2c33d9b262204ff0b8d24a941d89
Author: rsiddharth <rsiddharth@ninthfloor.org>
Date:   Thu,  5 Jun 2014 14:57:50 +0530

first zarking commit.

Diffstat:
.gitignore | 2++
COPYING | 14++++++++++++++
README.md | 33+++++++++++++++++++++++++++++++++
src/gitb-init.sh | 26++++++++++++++++++++++++++
4 files changed, 75 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -0,0 +1 @@ +*~+ \ No newline at end of file diff --git a/COPYING b/COPYING @@ -0,0 +1,14 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + diff --git a/README.md b/README.md @@ -0,0 +1,33 @@ +# gitb-init + +A dumb script that sets up a bare remote git repository for pushing & +pulling using the dumb protocol. + +## usage + + $ src/gitb-init.sh gitreponame.git [git_dir] [ssh_login] + +The command creates a remote bare repository `gitreponame.git` under +`git_dir` directory on the remote server. + +**defaults** + + git_dir="$HOME/git" + ssh_login="user@servername.tld" + +`git_dir` is the directory under which the remote bare git repo is +created. Change this variable's value as you see fit. + +`ssh_login` is set to a dummy value, you must set this. + +## contact + +**rsiddharth** <rsiddharth@ninthfloor.org> + +## license + +The script is under the [WTFPL version 2 license][3]. See COPYING for more +details. This license is [compatible with GNU GPL][4]. + +[3]: http://www.wtfpl.net/txt/copying/ +[4]: http://www.gnu.org/licenses/license-list.html#WTFPL diff --git a/src/gitb-init.sh b/src/gitb-init.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Copyright 2014 rsiddharth <rsiddharth@ninthfloor.org> +# +# This work is free. You can redistribute it and/or modify it under +# the terms of the Do What The Fuck You Want To Public License, +# Version 2, as published by Sam Hocevar. See the COPYING file or +# <http://www.wtfpl.net/> for more details. + +repo_name=$1 + +git_dir="$HOME/git" # default location. change it if you want. +ssh_login="user@servername.tld" # default ssh_login. you must change this. + +if [ -n "$2" ]; then + git_dir=$2 +fi + +repo_path="$git_dir/$repo_name" + +if [ -n "$3" ]; then + ssh_login=$3 +fi + +ssh_cmd="mkdir -p $repo_path && cd $repo_path && git init --bare && mv hooks/post-update.sample hooks/post-update" +ssh $ssh_login $ssh_cmd