-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit_install_personal_repo_pull
More file actions
50 lines (45 loc) · 1.38 KB
/
Copy pathgit_install_personal_repo_pull
File metadata and controls
50 lines (45 loc) · 1.38 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/bash
#Checks if git is installed--if not, installs git
#Using user input, asks for repo URL user wants to clone and:
####clones repo, sets global username, global user email address, and global editor
#Parses cloned repo URL, CDs into new repo, and:
####sets local username, local user email address, and local editor
#https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
##Checks if user wants git installed
echo "Do you need to install git? "
read needgit
if "$needgit" = "yes"
then
sudo yum -y install git
fi
##Clone Repo
echo "What is repo URL that you want to clone? "
read myclone
git clone "$myclone"
##Checks if user wants global git configurations
echo "Do you want to set global configurations? "
read myvar
if "$myvar" = "yes"
then
echo "What is global user name? "
read myvar2
git config --global user.name "$myvar2"
echo "What is global user email? "
read myvar3
git config --global user.email "$myvar3"
echo "What is global editor? "
read myvar4
git config --global core.editor "$myvar4"
fi
##Local repo configurations
current_repo=${myclone##*/}
cd $current_repo
echo "What is local user name? "
read cur_repo_var
git config user.name "$cur_repo_var"
echo "What is local user email? "
read cur_repo_var2
git config user.email "$cur_repo_var2"
echo "What is local editor? "
read cur_repo_var3
git config core.editor "$cur_repo_var3"