forked from SpiritQuaddicted/quake-code-archives
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodearchives.sh
More file actions
30 lines (26 loc) · 774 Bytes
/
codearchives.sh
File metadata and controls
30 lines (26 loc) · 774 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
scriptdir=$(pwd)
workingdir=~/archives
# don't prompt for user/pass, just keep going
export GIT_TERMINAL_PROMPT=0
# initial grabbing, simply errors if the directory exists so re-running on the same repo does not hurt
cd "${workingdir}"
echo "git cloning"
while read repo
do
git clone ${repo//https:\/\//http:\/\/foo:bar@} # no quotes here, git needs to see both arguments separatedly ;)
done < ${scriptdir}/repos.git
echo "git svn cloning"
while read repo
do
git svn clone ${repo} # no quotes here, git needs to see both arguments separatedly ;)
done < ${scriptdir}/repos.svn
# updating
cd "${workingdir}"
echo "git pulling, git svn fetching"
for dir in */
do
echo "Updating ${dir} ..."
cd "${workingdir}/${dir}"
git pull -u # try git
git svn fetch # try svn
done