Changes

Jump to navigation Jump to search
1,392 bytes added ,  13:19, 24 October 2016
no edit summary
== Switch to using Git ==
Have an 'old' mediawiki instance running off un-versioned code that you want to convert over to git? Here's a script that can help you get going. Note: it will DELETE all directories in your current working directory if they are NOT already git-managed. Use only if you know what you're doing!! Use it from inside your extensions directory
 
<source lang="bash">
#!/bin/bash
release="REL1_27"
git_root="https://github.com/wikimedia/mediawiki"
git_extension_root="${git_root}-extensions-"
 
extension_dir=`pwd`
 
for f in *; do
if [ -d ${f} ]; then
# Will not run if no directories are available
echo $f
cd $f
# check for .git directory
if [ -d ".git" ]; then
git fetch
git checkout $release
else
cd $extension_dir
rm -rf ./${f}
# when $f == 'Bootstrap' we want to clone the following:
# https://github.com/wikimedia/mediawiki-extensions-Bootstrap.git
git clone "${git_extension_root}${f}.git"
cd $f
git checkout $release
fi
## add any composer managed dependencies
if [ -f "./composer.json" ]; then
composer update;
fi
# back to the extension directory
cd $extension_dir;
rename 's/mediawiki-extensions-//' mediawiki-extensions-*
fi
done
 
 
 
</source>
{{References}}
[[Category:Wiki]]
4,558

edits

Navigation menu