-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_repos.sh
45 lines (38 loc) · 1.02 KB
/
setup_repos.sh
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
#!/bin/bash
echo "\ncloning github repos\n
please, input your git credentials below\n"
read -p "username: " username
read -p "password: " password
git clone "https://$username:$password@github.com/jayme-anchante/repos"
while read p
do
dir=$(echo $p | cut -d "/" -f 2)
repo=$(echo $p | cut -d "/" -f 3)
mkdir -p $dir
cd $dir
git clone "http://"$username":"$password$p
cd $repo
git fetch --all
cd ../../
done < repos/private.txt
while read p
do
git clone "https://github.com/jayme-anchante/$p"
dir=$(echo $p | cut -d "/" -f 2)
repo=$(echo $p | cut -d "/" -f 3)
mkdir -p $dir
cd $dir
git clone "http://"$p
cd $repo
git fetch --all
cd ../../
done < repos/public.txt
echo "creating a git-credentials file in ~/.git-credentials
please input information down below as follows
protocol=https
host=github.com
username=yourusername
password=yourpassword
"
git config --global credential.helper 'store --file ~/.git-credentials'
git credential-store --file ~/.git-credentials store