summaryrefslogtreecommitdiff
path: root/.local/bin/rgit
blob: 936f7e7035c02f7fef205f401f09be2f40b75661 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

# login
USER=root
HOST=cianb.xyz

# git dir
DIR=/var/www/git.cianb.xyz

# description
read -p "Description: " DESC

# init script
SCRIPT="cd $DIR;\
	sudo -u git mkdir $1;\
	sudo -u git git init $1 --bare;\
	echo $DESC > $1/description;"

# login and run
ssh $USER@$HOST $SCRIPT

# add remote
git remote add origin git@$HOST:$DIR/$1