summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <rsiddharth@ninthfloor.org>2014-06-05 14:57:50 +0530
committerrsiddharth <rsiddharth@ninthfloor.org>2014-06-05 14:57:50 +0530
commit17222d25eb8d2c33d9b262204ff0b8d24a941d89 (patch)
treee38ff5d403e3d5246b9fd15c192fc2fae6e3c7d6
first zarking commit.
-rw-r--r--.gitignore1
-rw-r--r--COPYING14
-rw-r--r--README.md33
-rwxr-xr-xsrc/gitb-init.sh26
4 files changed, 74 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e4e5f6c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*~ \ No newline at end of file
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..5a8e332
--- /dev/null
+++ 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
new file mode 100644
index 0000000..e85ffa0
--- /dev/null
+++ 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
new file mode 100755
index 0000000..7df08ac
--- /dev/null
+++ 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