Created
June 13, 2018 21:07
-
-
Save tonejito/9cbd84b4101efeadc62df3d67e3c12f5 to your computer and use it in GitHub Desktop.
Create @moodle bare git repository for local dev and testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create @moodle bare git repository for local dev and testing | |
# | |
# Andres Hernandez - tonejito | |
# Released under the BSD license | |
# | |
# We only care about releases between past and current LTS | |
# 3.1 LTS to 3.5 LTS at the time of writing | |
# https://docs.moodle.org/dev/Releases#Version_support | |
# | |
# After running this script we push this repo to our GitLab instance | |
# and clone everything from there | |
SHELL=/bin/bash | |
REPO=https://github.com/moodle/moodle.git | |
.PHONY: moodle moodle.git | |
# Clone repo as "moodle.git" in current directory | |
moodle: | |
test -d [email protected] || git clone --bare --shared --branch master --single-branch ${REPO} [email protected] | |
$(MAKE) -C [email protected] -f ../Makefile [email protected] | |
du -sm [email protected] | |
# Add branches for the selected set of STABLE releases | |
# This way we can clone the repo in other projects | |
moodle.git: | |
git branch --all | |
for RELEASE in {31..35} ; \ | |
do \ | |
git remote set-branches --add origin MOODLE_$${RELEASE}_STABLE ; \ | |
git fetch origin MOODLE_$${RELEASE}_STABLE:MOODLE_$${RELEASE}_STABLE ; \ | |
done | |
git fetch | |
git branch --all | |
git gc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment