Zend Studio for Eclipse > GIT Support für git.drupal.org einrichten {CVS to GIT}

Als wahrer Drupal Freund habt ihr es sicher mitbekommen: Vor einigen Wochen wurden alle Projekte auf drupal.org vom in die Jahre gekommenen Versionierungssystem "CVS" (quasi Vorgänger von Subversion) auf "Git" umgestellt.

Git ist derzeit in aller Munde und Ressourcen wie "github" kennt wohl jeder Entwickler. Größter Vorteil bei Git: Leichtigkeit und verteilte Versionskontrolle!

Dieser Eintrag soll allen helfen, die nun in der Drupal Modulentwicklung auf Git-Basierung umsteigen und das Zend Studio (8 in meinem Fall) oder Eclipse (z.B. PDT) einsetzen.

Schritt 1: EGit Plugin installieren
Als Git Plugin für Eclipse empfiehlt sich das etablierte EGit.

Hierzu gibt es eine kurze und leicht verständliche Anleitung unter:
http://clintberry.com/2011/02/zend-studio-and-github/

Schritt 2: Git Account auf drupal.org anlegen
Sofern ihr noch keinen Git Account auf drupal.org besitzt, müsst ihr dazu die nötigen Vorbereitungen treffen.

Diese bestehen daraus, die entsprechenden Bedingungen auf drupal.org in eurem Benutzerprofil (Profil > Edit > Git) durch Anhaken zu akzeptieren und zum Anderen euren public key hochladen. Dies geschieht im benachbarten Public Keys-Tab.
Wie ihr einen public key generiert (sofern ihr noch keinen habt), wird ebenfalls hier beschrieben:
http://clintberry.com/2011/02/zend-studio-and-github/

Schritt 3: Projekt importieren
Eigentlich ist die Grundlage für diesen Schritt, dass ihr bereits Zugriff auf ein bestehendes Projekt besitzt, ein Sandbox-Projekt auf drupal.org anfodert oder (wenn ihr diese Anleitung unabhängig von drupal.org, z.B. für github nutzt), Zugriff auf ein anderes bestehendes Git Repository besitzt.
Hier ist zu erwähnen, dass wir kein neues Git Repository erzeugen wollen, was auch mit Eclipse problemlos über "New" > "Git Repository" im Dateisystem möglich ist.

Stattdessen importieren wir das bestehende Projekt durch folgende Schritte:

  1. Projektbrowser: Rechte Maustaste > "Import ..."
  2. Git Repository auswählen
  3. Clone anklicken
  4. Daten des (entfernten) Repositories angeben (für git.drupal.org ist hier zum Test das Drupal Projekt empfehlenswert:
    • [Benutzername (meist=drupal.org-Login]@git.drupal.org/project/drupal
    • Passwort: Euer drupal.org Passwort
    • Protokoll: http
  5. Im Folgenden werdet ihr dann noch aufgefordert, das Passwort zu eurem privat/public key einzugeben.
  6. Ihr wählt dann den entsprechenden branch aus... und los gehts!
  7. Danach müsst ihr noch via Rechte Maustaste PHP Project Support hinzufügen, damit das Projekt als PHP-Projekt von Eclipse angesehen wird.
  8. Ansonsten setze ich einmal ein vernünftig konfiguriertes Eclipse / Zend Studio zu Drupal-Zwecken voraus.

Und schon seid ihr voll im Git-Fieber!

Änderungen committen
Über die Team-Schaltfläche könnt ihr dann in euer Repository, ähnlich wie bei Subversion/CVS/..., committen, updaten und so weiter!

Wie ihr eure Änderungen dann nach Fertigstellung wieder aus eurem lokalen Git Repository zurück auf git.drupal.org bekommt, zeige ich euch demnächst!
Hier setze ich aktuell ein Konsolentool ein, evtl. funktioniert das aber auch viel besser via Eclipse?
Leider hatte ich noch keine Zeit für entsprechende Tests.

p.S. Diese Anleitung funktioniert natürlich mit etwas Kreativität quasi-identisch für GitHub, private Git Repositories, etc.!

Comments

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Internal paths in single or double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or path. Paths to files in single or double quotes, written as "files:somefile.ext", for example, are replaced with the appropriate URL that can be used to download the file.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><blockquote>
  • Lines and paragraphs break automatically.
  • Pairs of<blockquote> tags will be styled as a block that indicates a quotation.
  • You can enable syntax highlighting of source code with the following tags: <c>, <cpp>, <css>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <smarty>, <xml>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Textual smileys will be replaced with graphical ones.
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.