forked from MarkEWaite/jenkins-bugs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_branches
executable file
·20 lines (18 loc) · 974 Bytes
/
make_branches
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# This is a work in progress - does not yet do what needs to be done
for origin in $(git branch -a | grep origin.*JENKINS | sed 's!remotes/!!g'); do
bug=$(echo $origin | sed -e 's!.*JENKINS!JENKINS!g' -e 's!/.*$!!g')
branch=$(echo $origin | sed 's!origin/!!g')
dir=$(echo $origin | sed -e 's!.*JENKINS!JENKINS!g' -e 's!/!-!g')
( cd .. && \
git clone --branch $branch \
--single-branch \
--reference /var/lib/git/mwaite/bugs/jenkins-bugs.git \
https://github.com/MarkEWaite/jenkins-bugs \
$dir )
( cd ../$dir && \
git config remote.origin.pushurl [email protected]:MarkEWaite/jenkins-bugs.git &&
git remote add cache /var/lib/git/mwaite/bugs/jenkins-bugs.git && \
git config remote.cache.fetch $(git config --get remote.origin.fetch | sed 's/origin/cache/g') && \
git pull --all --prune )
done