Seite wählen

Sharing Git patches in a different way

von | Aug 18, 2016 | GitLab, Development

training_gitSometimes it is necessary to share git patches locally. Either you cannot push it to the public domain in a feature or master branch or you simply don’t have an internet connection – for example while working in a customer VPN reproducing issues locally.
You could hope for XMPP sending patch files or any other local transport. But if you don’t want to add, commit, format-patch and send a patch file you’ll obviously go for plain text copy paste of a ‚git diff‘ output. Editors and messengers tend to destroy the tab indent. Now what?
base64 encoding to the rescue.

michi@mbmif ~/coding/icinga/icinga2 (master) $ git diff | base64

Send the blob to your colleague who can easily apply it. Example on MacOS:

michi@mbmif ~/coding/icinga/icinga2 (master) $ base64 -D | patch -p1

Or if written to a temporary file:

michi@mbmif ~/coding/icinga/icinga2 (master) $ base64 -D < patchfile | patch -p1

More about working with Git and applying patches can be learned in our Git training sessions. There’s also a Git workshop during this years OSMC 🙂

1 Kommentar

Einen Kommentar abschicken

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Mehr Beiträge zum Thema GitLab | Development

Mein PHP-Trainingsprojekt

PHP Schulung Vor kurzem haben wir begonnen, eine neue Programmiersprache zu lernen – PHP. In der ersten Woche haben wir mit den Grundlagen wie Variablen, Arrays, Schleifen begonnen und uns schrittweise zu komplizierterer Syntax wie Funktionen, Objekten und Klassen...

check_prometheus ist jetzt öffentlich verfügbar!

Monitoring ist komplex, das wissen wir hier bei NETWAYS leider zu gut. Deswegen laufen in der Infrastruktur auch mal gerne mehrere Tools für die Überwachung. Zwei gern gesehene Kandidaten sind dabei Icinga und Prometheus. Icinga und Prometheus erfüllen...