Summary Files Commits Branches @commit @diff @stats
path: root / scripts / new
blob: 65e677a056cefa8000e0262553c1387e8d314715 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

while [ -z "$1" ]
do
	printf 'Repository: '
	read
	set "$REPLY"
done

set "${1##/}"

root_dir="${1%%/*}"
repo_dir="${1#*/}"

cd "$root_dir"
if git init --bare "$repo_dir"
then
	echo -e "\nClone repo with:\n\tgit clone git@syndamia.com:$1"
	echo -e "\nUpload local repo with:\n\tgit push git@syndamia.com:$1 '*:*'"
fi