-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgit-init.sh
More file actions
28 lines (27 loc) · 741 Bytes
/
git-init.sh
File metadata and controls
28 lines (27 loc) · 741 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
#/bin/bash
email=barsaliou1998@gmail.com
username=serignmbaye
repo=https://learn.zone01dakar.sn/git/serignmbaye/piscine-go.git
gitConfigDir=./.gitconfig/
if [ -d -a "$gitConfigDir" ]
then
echo "Removing git config directory : $gitConfigDir..."
rm -rf $gitConfigDir
fi
gitCredentialDir=./.git-credentials
if [ -d -a "$gitCredentialDir" ]
then
echo "Removing git credential directory : $gitCredentialDir..."
rm -rf $gitCredentialDir
fi
repoDir=./piscine-go
if [ -d -a "$gitCredentialDir" ]
then
echo "Removing repository directory : $repoDir..."
rm -rf $repoDir
fi
git config --global credential.helper store
git config --global user.email "$email"
git config --global user.name "$username"
git config --list
git clone "$repo"