From 17222d25eb8d2c33d9b262204ff0b8d24a941d89 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Thu, 5 Jun 2014 14:57:50 +0530 Subject: first zarking commit. --- src/gitb-init.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 src/gitb-init.sh (limited to 'src') diff --git a/src/gitb-init.sh b/src/gitb-init.sh new file mode 100755 index 0000000..7df08ac --- /dev/null +++ b/src/gitb-init.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Copyright 2014 rsiddharth +# +# 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 +# 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 -- cgit v1.2.3