Note: You are currently viewing documentation for Moodle 3.6. Up-to-date documentation for the latest stable version of Moodle is likely available here: Git for Mac.

Git for Mac: Difference between revisions

From MoodleDocs
m (tidy up)
No edit summary
Line 8: Line 8:
  #  of the installation package Moodle4Mac
  #  of the installation package Moodle4Mac
  #  
  #  
  #  20130514 - Ralf Krause
  #  20140714 - Ralf Krause
  #
  #
 
  echo
  echo
  echo "+--------------------------------------------+"
  echo "+--------------------------------------------+"
Line 16: Line 16:
  echo "+--------------------------------------------+"
  echo "+--------------------------------------------+"
  echo
  echo
 
  cd /Applications/MAMP/htdocs
  cd /Applications/MAMP/htdocs
 
  if ! test -e moodle25/.git ; then
  if ! test -e moodle27/.git ; then
     ## the first git update must get everything including .git
     ## the first git update must get everything including .git
     git clone --depth 1 -b MOODLE_25_STABLE git://github.com/moodle/moodle.git moodle25-git
     git clone --depth 1 -b MOODLE_27_STABLE git://github.com/moodle/moodle.git moodle27-git
     if test -e moodle25 ; then
     if test -e moodle27 ; then
         if test -e moodle25/config.php ; then
         if test -e moodle27/config.php ; then
             cp moodle25/config.php moodle25-git/.
             cp moodle27/config.php moodle27-git/.
         fi
         fi
         DATE=`date +%Y%m%d-%H%M`
         DATE=`date +%Y%m%d-%H%M`
         mv moodle25 moodle25-$DATE
         mv moodle27 moodle27-$DATE
     fi
     fi
     mv moodle25-git moodle25
     mv moodle27-git moodle27
     ## the old folder can be deleted now
     ## the old folder can be deleted now
     ## if you want to do this please remove '##' from the following line
     ## if you want to do this please remove '##' from the following line
     ## sudo rm -R moodle25-*
     ## sudo rm -R moodle27-*
  else
  else
     ## the next git update only gets the new files
     ## the next git update only gets the new files
     cd moodle25
     cd moodle27
     git pull
     git pull
     cd ..
     cd ..
Line 45: Line 45:


[[Category:Installation]]
[[Category:Installation]]
[[Category:Mac OS X]]
[[es:Git para Mac]]
[[es:Git para Mac]]

Revision as of 12:35, 21 July 2014

This GIT installer for Mac OS X is part of the installation package Moodle4Mac by Ralf Krause

Code

#! /bin/sh
#
#  This GIT installer for Mac OS X is part 
#  of the installation package Moodle4Mac
# 
#  20140714 - Ralf Krause
#

echo
echo "+--------------------------------------------+"
echo "| GIT updater for your local Moodle server"
echo "+--------------------------------------------+"
echo

cd /Applications/MAMP/htdocs

if ! test -e moodle27/.git ; then
   ## the first git update must get everything including .git
   git clone --depth 1 -b MOODLE_27_STABLE git://github.com/moodle/moodle.git moodle27-git
   if test -e moodle27 ; then
       if test -e moodle27/config.php ; then
           cp moodle27/config.php moodle27-git/.
       fi
       DATE=`date +%Y%m%d-%H%M`
       mv moodle27 moodle27-$DATE
   fi
   mv moodle27-git moodle27
   ## the old folder can be deleted now
   ## if you want to do this please remove '##' from the following line
   ## sudo rm -R moodle27-*
else
   ## the next git update only gets the new files
   cd moodle27
   git pull
   cd ..
fi


See also

Git for Administrators