forked from Breigner01/my_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepo_init
More file actions
executable file
·38 lines (34 loc) · 788 Bytes
/
repo_init
File metadata and controls
executable file
·38 lines (34 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
function helps {
echo -e "USAGE:"
echo -e "\trepo [Domain] [Repo name]\n"
echo -e "DESCRIPTION:"
echo -e "\tDomain\tgithub or epitech depending of where your repo is"
echo -e "\tRepo name\tthe name of the repository"
}
if [ "$#" -eq 2 ]
then
if [ $1 = github ]
then
url="git@github.com:Breigner01/"
end=".git"
elif [ $1 = epitech ]
then
url="git@git.epitech.eu:benjamin.reigner@epitech.eu/"
end=""
else
echo -e "\e[38;5;45mUnknown domain\e[0m"
exit
fi
repo=$2
else
echo -e "\e[38;5;45mWrong number of arguments\e[0m"
helps
exit
fi
repo_url=$url$repo$end
git init
git add --all
git commit -m "First commit"
git remote add origin $repo_url
git push -u origin master