Hinweis: Sie sind auf den Seiten der Moodle 2.0 Dokumentation. Die Dokumentation der aktuellsten Moodle-Version finden Sie hier: Git für Administratoren.

Git für Administratoren: Unterschied zwischen den Versionen

Aus MoodleDocs
Wechseln zu:Navigation, Suche
Keine Bearbeitungszusammenfassung
Zeile 2: Zeile 2:


{{Zum Übersetzen}}
{{Zum Übersetzen}}
The recommended way (now all Moodle development has moved to this versioning system) is Git. This page describes how to maintain a copy of Moodle on your production server which can easily be upgraded using Git. If you have customisations of Moodle core code, you are advised to follow the instructions in the [[Development:Quick Git start guide for Moodle development|Quick Git start guide for Moodle development]].
Die empfohlene Vorgehensweise ist Git ('''Achtung''': Bis jetzt ist noch nicht die gesamte Moodle-Code-Entwicklung auf dieses Versionierungssystem umgezogen!). Dieser Artikel beschreibt, wie Sie Moodle auf Ihrem Produktivserver über Git aktualisieren. Wenn Sie eigene Codeanpassungen haben, folgen Sie den Anleitungen in diesem Artikel [[Development:Quick Git start guide for Moodle development|Quick Git start guide for Moodle development]] (englisch).


To get the most of of Git it is worth making the effort to understand its basic concepts - see the See also section below. It can be a bit of a learning curve, especially if you are used to CVS or Subversion.  
Um Git effektiv nutzen zu können, sollten Sie die wichtigsten Konzepte verstanden haben (siehe Quellenangaben im Abschnitt ''Siehe auch''). Das kann einen gewissen Einarbeitsaufwand erfordern, insbesondere wenn Sie bisher mit CVS oder Subversion gearbeitet haben.  


== Getting hold of Git (Windows, OSX, Linux and others) ==


Support for Git was, up until recently, mostly confined to Linux but builds are now available for most popular operating systems:


* List of downloads from Git site - http://git-scm.com/download
== Git (Windows, OSX, Linux) ==
*Eine Download-Liste für verschiedene Betriebssysteme finden Sie auf der Git-Seite http://git-scm.com/download.
*Wenn Sie Git heruntergeladen und auf Ihrem System installiert haben, sollten die im folgenden beschriebenen Befehle funktionieren.


Once you have downloaded and installed your OS relevant git installation, the git commands in this document should work with your operating system.
== Moodle-Code über Git holen==
Hier beschreiben wir die kommandozeilen-basierte Version von Git. Grafische Benutzeroberflächen sind letztendlich nur Hüllen, darunter verbirgt sich ebenfalls die Kommandozeilenversion.


== Obtaining the code from Git ==
Das offizielle Moodle Git Repository finden Sie unter http://git.moodle.org/gw?p=moodle.git;a=summary (ein offizieller Clone liegt unter https://github.com/moodle/moodle). Um einen lokalen Checkout zu initialisieren, verwenden Sie folgende Befehle
 
The command line version of Git is discussed here. Graphical clients are little more than wrappers around the command line version, so you should be able to deduce the correct parameters quite easily.
 
You can find the official Moodle git repository at git://git.moodle.org/moodle.git (with an official clone at git://github.com/moodle/moodle.git). To initialize your local checkout, use
<pre>
<pre>
$ git clone git://git.moodle.org/moodle.git                      (1)
$ git clone http://git.moodle.org/moodle.git                      (1)
$ cd moodle
$ cd moodle
$ git branch -a                                                   (2)
$ git branch -a                                                   (2)
$ git branch --track MOODLE_22_STABLE origin/MOODLE_22_STABLE      (3)
$ git branch --track MOODLE_22_STABLE origin/MOODLE_22_STABLE      (3)
$ git checkout MOODLE_22_STABLE                                    (4)
$ git checkout MOODLE_22_STABLE                                    (4)
</pre>
</pre>
* The command (1) initializes the new local repository as a clone of the 'upstream' (i.e. the remote server based) moodle.git repository. The upstream repository is called 'origin' by default. It creates a new directory named ''moodle'', where it downloads all the files. This operation can take a while as it is actually getting the entire history of all Moodle versions
* Befehl(1) initialisiert das neue lokale Repository als einen Clone des Remote moodle.git Repository. Das Remote Repository wird standardmäßig als ''Quelle'' bezeichnet. Es legt ein neues Verzeichnis ''moodle'' an, in das alle Dateien heruntergeladen werden. Dieser Prozess kann eine Weile dauern, weil die gesamte Historie aller Moodle-Versionen mit gezogen wird.
* The command (2) lists all available branches.
* Befehl (2) listet alle verfügbaren Zweige (branches) auf.
* Use the command (3) to create a new local branch called MOODLE_22_STABLE and set it to track the remote branch MOODLE_22_STABLE from the upstream repository.
* Mit Befehl (3) legen Sie einen neuen lokalen Zweig (Branch) an, der MOODLE_22_STABLE heißt, und setzen diesen Zweig so, dass er dem Remote branch MOODLE_22_STABLE vom Remote Repository  folgt.
* The command (4) actually switches to the newly created local branch.  
* Befehl (4) stellt auf den neuen lokalen Zweig um.  


Note that Git has a huge number of options for each command and it's actually possible to do the above process with a single command (left as an exercise!!).
Note that Git has a huge number of options for each command and it's actually possible to do the above process with a single command (left as an exercise!!).

Version vom 8. Juni 2012, 10:42 Uhr


Baustelle.png Diese Seite ist noch nicht vollständig übersetzt.

Die empfohlene Vorgehensweise ist Git (Achtung: Bis jetzt ist noch nicht die gesamte Moodle-Code-Entwicklung auf dieses Versionierungssystem umgezogen!). Dieser Artikel beschreibt, wie Sie Moodle auf Ihrem Produktivserver über Git aktualisieren. Wenn Sie eigene Codeanpassungen haben, folgen Sie den Anleitungen in diesem Artikel Quick Git start guide for Moodle development (englisch).

Um Git effektiv nutzen zu können, sollten Sie die wichtigsten Konzepte verstanden haben (siehe Quellenangaben im Abschnitt Siehe auch). Das kann einen gewissen Einarbeitsaufwand erfordern, insbesondere wenn Sie bisher mit CVS oder Subversion gearbeitet haben.


Git (Windows, OSX, Linux)

  • Eine Download-Liste für verschiedene Betriebssysteme finden Sie auf der Git-Seite http://git-scm.com/download.
  • Wenn Sie Git heruntergeladen und auf Ihrem System installiert haben, sollten die im folgenden beschriebenen Befehle funktionieren.

Moodle-Code über Git holen

Hier beschreiben wir die kommandozeilen-basierte Version von Git. Grafische Benutzeroberflächen sind letztendlich nur Hüllen, darunter verbirgt sich ebenfalls die Kommandozeilenversion.

Das offizielle Moodle Git Repository finden Sie unter http://git.moodle.org/gw?p=moodle.git;a=summary (ein offizieller Clone liegt unter https://github.com/moodle/moodle). Um einen lokalen Checkout zu initialisieren, verwenden Sie folgende Befehle

$ git clone http://git.moodle.org/moodle.git                       (1)
$ cd moodle
$ git branch -a                                                    (2)
$ git branch --track MOODLE_22_STABLE origin/MOODLE_22_STABLE      (3)
$ git checkout MOODLE_22_STABLE                                    (4)
  • Befehl(1) initialisiert das neue lokale Repository als einen Clone des Remote moodle.git Repository. Das Remote Repository wird standardmäßig als Quelle bezeichnet. Es legt ein neues Verzeichnis moodle an, in das alle Dateien heruntergeladen werden. Dieser Prozess kann eine Weile dauern, weil die gesamte Historie aller Moodle-Versionen mit gezogen wird.
  • Befehl (2) listet alle verfügbaren Zweige (branches) auf.
  • Mit Befehl (3) legen Sie einen neuen lokalen Zweig (Branch) an, der MOODLE_22_STABLE heißt, und setzen diesen Zweig so, dass er dem Remote branch MOODLE_22_STABLE vom Remote Repository folgt.
  • Befehl (4) stellt auf den neuen lokalen Zweig um.

Note that Git has a huge number of options for each command and it's actually possible to do the above process with a single command (left as an exercise!!).

Git from behind a firewall

Git uses a proprietary protocol and it may be blocked by your firewall (port 9418). If this is a problem, you can use Github's http version https://github.com/moodle/moodle.git. It's a bit slower, so use the Git protocol if you can.

Updating your installation

The Moodle development team performs integration and testing of fixed bugs every Monday and Tuesday. On Wednesday you can install all patches by updating your code. Check the shortlog to see if the official repository has been already updated or not.

To update your code to the latest version (on the MOODLE_22_STABLE branch) all you have to do is:

$ cd /path/to/your/moodle/
$ git pull

If this is a production site you should still consider the Upgrade instructions (e.g. take backups).

Installing a contributed extension from its Git repository

This is one way to handle adding plugins from other Git repositories into your Moodle repository. Another way is to use Git Submodules. However, at the time of writing, this is one of Git's rougher features and should be regarded as an advanced option.

For example, let us say we want to install the Book module form its Git repository into our Moodle 2.2.

$ cd /path/to/your/moodle/
$ cd mod                                                          (1)
$ git clone git://github.com/skodak/moodle-mod_book.git book      (2)
$ cd book
$ git checkout -b MOODLE_22_STABLE origin/MOODLE_22_STABLE        (3)
$ git branch -d master                                            (4)

The command (1) changes the current directory into the mod folder of your local Moodle clone. The command (2) creates a new subdirectory book and makes a local clone of Petr Škoda's vanilla Book repository. The command (3) creates a new local branch that will track the remote branch with a Book version for Moodle 2.1. The command (4) deletes the master that was created automatically by git-clone in (2) as we do not want it in this production checkout.

Now it is wise to put the new directory mod/book/ to the list of ignored files of the main Moodle clone, otherwise a status of the main clone will keep reminding you that the new code has not been checked in.

$ cd /path/to/your/moodle/
$ echo /mod/book/ >> .git/info/exclude

To update your Moodle installation now, you must visit both Git repositories and pull changes from upstream.

$ cd /path/to/your/moodle/
$ git pull
$ cd mod/book
$ git pull

Writing a shell script with these lines in the root of Moodle installation is a very good idea. Otherwise it is easy to forget what Git repositories are there within the main Moodle repository.

Siehe auch

Moodle Docs:


Diskussionsbeiträge auf moodle.org:


Externe Quellen: