Commit 8886cf30 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Imported fetch-stable-branches script

parent e34e32c2fc93
......@@ -60,5 +60,19 @@
- Mercurial local path: `omnibus-heptapod`
- Mercurial push to: [heptapod/omnibus-heptapod](https://foss.heptapod.net/heptapod/omnibus-heptapod)
## Fetching from upstream
In all cases, change first directory to the local Git clone. Example:
```
cd gitlab-ce
```
For the main repository and Omnibus, run:
```
../fetch-stable-branches
```
[the present project]: https://foss.heptapod.net/heptapod/upstream-conversion
#!/bin/sh
#
# GitLab must have some kind of protection, because a blank 'git fetch'
# does not fetch all branches
if ! test -d .git; then
echo "Please run from the upstream Git clone (gitlab-ce, omnibus-gitlab etc.)"
exit 1
fi
set -e
if [ -z "$1" ]; then
echo "Fetching all stable branches from remote 'origin'"
BRANCHES=$(git ls-remote origin \
| grep -E 'refs/heads/13-[0-9]+.*-stable$' \
| sed 's/.*refs\/heads\///g')
fi
for BRANCH in $BRANCHES; do
echo "Fetching Git branch $BRANCH"
git fetch origin $BRANCH
git branch -f $BRANCH origin/$BRANCH
echo
done
echo "Fetching all tags"
git fetch --tags
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment