Compare commits
No commits in common. "master" and "v1.0.0" have entirely different histories.
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,6 +2,4 @@
|
|||||||
*.log
|
*.log
|
||||||
*.*~
|
*.*~
|
||||||
*.toc
|
*.toc
|
||||||
*.dvi
|
|
||||||
|
|
||||||
|
|
||||||
|
478
Git.tex
478
Git.tex
@ -6,20 +6,14 @@
|
|||||||
\usepackage{float}
|
\usepackage{float}
|
||||||
\usepackage{german}
|
\usepackage{german}
|
||||||
\usepackage{ae}
|
\usepackage{ae}
|
||||||
\usepackage{alltt}
|
|
||||||
\usepackage{amssymb}
|
|
||||||
|
|
||||||
\usepackage[utf8]{inputenc} % Umlaute und dt. Zeichen Kodieren
|
\usepackage[latin1]{inputenc} % Umlaute und dt. Zeichen Kodieren
|
||||||
|
|
||||||
% ae.sty verwenden!
|
% ae.sty verwenden!
|
||||||
\usepackage[T1]{fontenc} % ec* Schriftarten verwenden
|
\usepackage[T1]{fontenc} % ec* Schriftarten verwenden
|
||||||
|
|
||||||
\usepackage{times} % Times-Schriftart (pdf)
|
\usepackage{times} % Times-Schriftart (pdf)
|
||||||
\usepackage{calc}
|
\usepackage{calc}
|
||||||
\usepackage{lmodern}
|
|
||||||
|
|
||||||
\setcounter{secnumdepth}{4}
|
|
||||||
\setcounter{tocdepth}{4}
|
|
||||||
|
|
||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
@ -394,134 +388,7 @@ Als GIT-Serversoftware empfehle ich an dieser Stelle gogs\footnote{https://gogs.
|
|||||||
Wenn du dich damit besch"aftigen willst, solltest du aber "uber gute Linuxkenntnisse
|
Wenn du dich damit besch"aftigen willst, solltest du aber "uber gute Linuxkenntnisse
|
||||||
verf"ugen.\\
|
verf"ugen.\\
|
||||||
Mit gogs hast du eine Weboberfl"ache, "ahnlich wie bei GitHub, unter der du deine Projekte
|
Mit gogs hast du eine Weboberfl"ache, "ahnlich wie bei GitHub, unter der du deine Projekte
|
||||||
recht einfach verwalten kannst. Du hast auch die M"oglichkeit, private Projekte dort anzulegen
|
recht einfach verwalten kannst. Du hast auch die M"oglichkeit, private Projekte dort anzulegen.
|
||||||
und mit Hilfe der Benutzerverwaltung kannst du auch Einfluss darauf nehmen, was deineTeammitgleider
|
|
||||||
alles so d"urfen.
|
|
||||||
|
|
||||||
\subsection{gogs}
|
|
||||||
Gogs ist ein kleines, aber feines Projekt, das ein Webfrontend f"ur einen git-Server bereitstellt.
|
|
||||||
Es ist in der Programmiersprache go geschrieben und ben"otigt nur minimale Resourcen.
|
|
||||||
|
|
||||||
\subsubsection{Vorbereiten der Datenbank}
|
|
||||||
Bevor du dir gogs herunterl"adst und installierst, solltest du das Datenbanksystem
|
|
||||||
ausw"ahlen, das gogs sp"ater benutzen soll. Du kannst zwischen MariaDB/MySQL und PostgreSQL
|
|
||||||
w"ahlen. Gut, es giobt noch SQLite, MSSQL oder TiDB nutzen, aber die ersten beiden will man
|
|
||||||
nicht wirklich und TiDB ist wohl noch zu speziell. Achte darauf, dass MySQL/MariaDB auch
|
|
||||||
tats"achlich auf dem Netzwerkinterface horcht, das du bei der Installation angibst!\\
|
|
||||||
|
|
||||||
\paragraph{PostgreSQL}
|
|
||||||
Am einfachsten loggst du dich per ``sudo su - postgres'' als Benutzer postgres in deiner
|
|
||||||
Shell auf deinem GIT-Server ein, dann erzeugst du per ``createuser -P -d gogs'' einen Benutzer
|
|
||||||
f"ur die Datenbank ``gogs''.\\
|
|
||||||
Im n"achsten Schritt loggst du dich auf der Shell per ``psql -h localhost template1 gogs''
|
|
||||||
in das Datenbanksystem ein. Hier reicht nun ein ``CREATE DATABASE gogs;'', um die Datenbank
|
|
||||||
f"ur gogs anzulegen.
|
|
||||||
|
|
||||||
\paragraph{MariaDB/MySQL}
|
|
||||||
Du loggst dich mit dem administrativen Benutzer in MariaDB/MySQL, den du bei der Installation
|
|
||||||
eingerichtet hast, in das Datenbanksystem ein. Das ist oft der Datenbankbenutzer ``root''
|
|
||||||
(nicht zu verwechseln mit dem Systembenutzer ``root''). Also ``mysql -p -u root''. Nun
|
|
||||||
erfolgt ein ``GRANT ALL PRIVILEGES ON gogs.* to 'gogs'@'localhost' IDENTIFIED BY
|
|
||||||
'geheimes passwort';''. Dann loggst du dich aus, loggst dich per ``mysql -p -u gogs''
|
|
||||||
wieder ein und f"uhrst ein ``CREATE DATABASE gogs CHARACTER SET utf8mb4;'' aus,
|
|
||||||
um die Datenbank f"ur gogs anzulegen.
|
|
||||||
\\
|
|
||||||
\textbf{Hinweis:} Sollte bei Benutzung von MariaDB w"ahrend der Installation im
|
|
||||||
Webbrowser die Fehlermeldung ``Datenbankeinstellungen sind nicht korrekt: Error 1071: Specified key was too long; max key length is 767 bytes'', dann folgende Befehle in der
|
|
||||||
MariaDB-Kommandozeile ausf"uhren:
|
|
||||||
\begin{verbatim}
|
|
||||||
set global innodb_large_prefix=on;
|
|
||||||
set global innodb_file_format=Barracuda;
|
|
||||||
\end{verbatim}
|
|
||||||
|
|
||||||
\subsubsection{Installation}
|
|
||||||
Bevor du dir gleich die Software runterl"adst, lege bitte einen Benutzer ``git'' auf deinem
|
|
||||||
Server an, sofern der Benutzer noch nicht existiert.\\
|
|
||||||
Von https://gogs.io/docs/installation/install\_from\_binary l"adt man sich die passende Version
|
|
||||||
f"ur seinen Server runter und entpackt diese. Das entstandene Verzeichnis wird dann in das
|
|
||||||
Benutzerverzeichnis des Benutzers ``git'' verschoben und diesem zu eigen gemacht (chown).\\
|
|
||||||
Im Verzeichnis gogs/scripts findest du Beispiele, um gogs auf deinem System bei Systemstart
|
|
||||||
automatisch zu starten. Das geht zum Beispiel via init oder systemd.\\
|
|
||||||
Nat"urlich solltest du die Dateien entsprechend f"ur dein System anpassen, sonst stimmen
|
|
||||||
die Pfade unter Umst"anden nicht.
|
|
||||||
|
|
||||||
\subsubsection{Konfigurationsdatei}
|
|
||||||
Um sp"ater noch ein wenig Feintuning vorzunehmen, kann man im Verzeichnis ``custom/conf''
|
|
||||||
die Datei ``app.ini'' "andern, die bei der Installation automatisch angelegt wird.\\
|
|
||||||
Ein Beispiel f"ur eine app.ini:
|
|
||||||
\begin{verbatim}
|
|
||||||
APP_NAME = Gogs
|
|
||||||
RUN_USER = git
|
|
||||||
RUN_MODE = prod
|
|
||||||
|
|
||||||
[repository]
|
|
||||||
ROOT = /home/git/repositories
|
|
||||||
|
|
||||||
[database]
|
|
||||||
DB_TYPE = postgres
|
|
||||||
HOST = 127.0.0.1:5432
|
|
||||||
NAME = gogs
|
|
||||||
USER = gogs
|
|
||||||
PASSWD = GEHEIM
|
|
||||||
SSL_MODE = disable
|
|
||||||
PATH = data/gogs.db
|
|
||||||
|
|
||||||
[server]
|
|
||||||
DOMAIN = git.hauke-zuehl.de
|
|
||||||
HTTP_PORT = 3000
|
|
||||||
ROOT_URL = https://git.hauke-zuehl.de/
|
|
||||||
DISABLE_SSH = false
|
|
||||||
SSH_PORT = 22
|
|
||||||
START_SSH_SERVER = false
|
|
||||||
OFFLINE_MODE = false
|
|
||||||
|
|
||||||
[mailer]
|
|
||||||
ENABLED = false
|
|
||||||
|
|
||||||
[service]
|
|
||||||
REGISTER_EMAIL_CONFIRM = true
|
|
||||||
ENABLE_NOTIFY_MAIL = true
|
|
||||||
DISABLE_REGISTRATION = true
|
|
||||||
ENABLE_CAPTCHA = true
|
|
||||||
REQUIRE_SIGNIN_VIEW = true
|
|
||||||
|
|
||||||
[picture]
|
|
||||||
DISABLE_GRAVATAR = false
|
|
||||||
ENABLE_FEDERATED_AVATAR = true
|
|
||||||
|
|
||||||
[session]
|
|
||||||
PROVIDER = file
|
|
||||||
|
|
||||||
[log]
|
|
||||||
MODE = file
|
|
||||||
LEVEL = Info
|
|
||||||
ROOT_PATH = /home/git/gogs/log
|
|
||||||
|
|
||||||
[security]
|
|
||||||
INSTALL_LOCK = true
|
|
||||||
\end{verbatim}
|
|
||||||
Bitte daran denken, dass diese Datei als Eigent"umer den Benutzer ``git'' haben muss!
|
|
||||||
Wenn du aber bei der Installation oben alles korrekt eingetragen hast, sollte
|
|
||||||
es keine Probleme geben.\\
|
|
||||||
In diesem Beispiel habe ich "ubrigens PostgreSQL als Datenbanksystem verwendet, du
|
|
||||||
kannst aber gerne MariaDB oder MySQL verwenden.
|
|
||||||
|
|
||||||
\subsubsection{Der erste Start}
|
|
||||||
|
|
||||||
Du startest gogs zun"achst "uber die Kommandozeil per ``./gogs web'' und gibst dann in
|
|
||||||
deinem Webbrowser die URL ``http://localhost:3000'' ein.\\
|
|
||||||
Du wirst nun durch die Konfiguration der Datenbank und von gogs gef"uhrt. Bei der Domain
|
|
||||||
solltest du den Server- oder einen ordentlichen Domainnamen eingeben. Hast du also zum
|
|
||||||
Beispiel einen kleinen RaspberryPi zu Hause, auf dem gogs laufen soll, und dieser heisst
|
|
||||||
``pi.deinzuhause.net'' dann gibst du eben diesen Namen bei der Domain und der Application
|
|
||||||
URL ein.\\
|
|
||||||
Den Datenbankbenutzer f"ur gogs und die entsprechende Datenbank solltest du nun auch
|
|
||||||
anlegen, sonst kracht es bei der Einrichtung der Tabellen.\\
|
|
||||||
Hast du soweit alles eingetragen, kannst du dich anmelden und deine Projekte mit gogs
|
|
||||||
verwalten.\\
|
|
||||||
Der erste Benutzer, der sich registriert bei gogs, wird "ubrigens als Administrator
|
|
||||||
angelegt, also Obacht! Von nun kannst du gogs in aller Ruhe erforschen und
|
|
||||||
eigene Repositores anlegen, Organiosationen und Teams erzeugen, usw.!
|
|
||||||
|
|
||||||
\section{GIT from scratch}
|
\section{GIT from scratch}
|
||||||
Ich habe keine bessere "Uberschrift gefunden, aber wenn du keine Lust auf GitHub oder gogs oder
|
Ich habe keine bessere "Uberschrift gefunden, aber wenn du keine Lust auf GitHub oder gogs oder
|
||||||
@ -530,9 +397,6 @@ Dann legst du als Benutzer ``root'' einen Benutzer ``git'' an. Hast du das erled
|
|||||||
du zum Benutzer ``git'' und legst ein Verzeichnis ``.ssh'' im Benutzerverzeichnis von ``git''
|
du zum Benutzer ``git'' und legst ein Verzeichnis ``.ssh'' im Benutzerverzeichnis von ``git''
|
||||||
an. In das Verzeichnis ``.ssh'' kommen in die Datei ``authorized\_keys'' die "offentlichen
|
an. In das Verzeichnis ``.ssh'' kommen in die Datei ``authorized\_keys'' die "offentlichen
|
||||||
SSH-Schl"ussel der Benutzer, die git benutzen d"urfen.\\
|
SSH-Schl"ussel der Benutzer, die git benutzen d"urfen.\\
|
||||||
Warum wird das mit den Schl"usseln gemacht?\\
|
|
||||||
Ganz einfach: Ansonsten m"usstest du jedem Teammitglied das Passwort des Benutzers ``git''
|
|
||||||
verraten und das willst du wirklich nicht!\\
|
|
||||||
Also:
|
Also:
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
sudo adduser git
|
sudo adduser git
|
||||||
@ -570,8 +434,7 @@ dicken Server, der irgendwo in einem Rechenzentrum in Deutschland steht.
|
|||||||
|
|
||||||
\chapter{Projekt ``Welt'' auf den Server bringen}
|
\chapter{Projekt ``Welt'' auf den Server bringen}
|
||||||
Nachdem du also einen GIT-Server irgendwie ans Laufen gebracht hast, oder du dich bei GitHub
|
Nachdem du also einen GIT-Server irgendwie ans Laufen gebracht hast, oder du dich bei GitHub
|
||||||
angemeldet hast, deinen "offentlichen SSH-Schl"ussel auf den Server geladen hast, soll das
|
angemeldet hast, soll das ``Welt''-Projekt nun auf den entfernten Server gebracht werden.
|
||||||
``Welt''-Projekt nun auf den entfernten Server gebracht werden.
|
|
||||||
|
|
||||||
Ob dein GIT-Server nun auf deinem Raspberry oder auf deinem lokalen Server l"auft, der Unterschied
|
Ob dein GIT-Server nun auf deinem Raspberry oder auf deinem lokalen Server l"auft, der Unterschied
|
||||||
liegt in der Benennung des Rechners. Ich erkl"are dir die folgenden Schritte unter der Annahme,
|
liegt in der Benennung des Rechners. Ich erkl"are dir die folgenden Schritte unter der Annahme,
|
||||||
@ -639,7 +502,7 @@ unterworfen sind. Dies sind meistens
|
|||||||
\item testing
|
\item testing
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
Um deine Arbeitskopie zu aktualisieren, wechselst du in den entsprechenden
|
Um deine Arbeitskopie zu aktualisieren, wechselst du in den entsprechenden
|
||||||
Zweig (zum Beispiel ``develop'') und f"uhrst dort \textit{git pull} aus.\\
|
Zwei (zum Beispiel ``develop'') und f"uhrst dort \textit{git pull} aus.\\
|
||||||
Damit werden die "Anderungen vom Server heruntergeladen und in deinen Zweig
|
Damit werden die "Anderungen vom Server heruntergeladen und in deinen Zweig
|
||||||
eingepflegt.\\
|
eingepflegt.\\
|
||||||
\\
|
\\
|
||||||
@ -693,7 +556,7 @@ Date: Thu Mar 22 15:07:54 2018 +0100
|
|||||||
Blah
|
Blah
|
||||||
|
|
||||||
commit 19a30b330ab250a6d3ab3f0a9ecf1c6d9b2d9fd5
|
commit 19a30b330ab250a6d3ab3f0a9ecf1c6d9b2d9fd5
|
||||||
Author: Hauke Zühl <hzuehl@phone-talk.net>
|
Author: Hauke Zühl <hzuehl@phone-talk.net>
|
||||||
Date: Thu Mar 22 13:40:59 2018 +0100
|
Date: Thu Mar 22 13:40:59 2018 +0100
|
||||||
|
|
||||||
LIESMICH angelegt
|
LIESMICH angelegt
|
||||||
@ -730,337 +593,6 @@ ein sch"ones Log auf den Bildschirm. Und wenn du die Kurzform
|
|||||||
der Commits haben willst, dann bringt dich
|
der Commits haben willst, dann bringt dich
|
||||||
\textit{git log --abbrev-commit --graph} ans Ziel.
|
\textit{git log --abbrev-commit --graph} ans Ziel.
|
||||||
|
|
||||||
\chapter{Ignorieren von Dateien}
|
|
||||||
Ich starte mal mit einem Beispiel, um zu zeigen, was das Problem ist:\\
|
|
||||||
Wir gehen jetzt davon aus, dass wir ein C++-Projekt compilieren, d.h.
|
|
||||||
aus dem Quellcode ein Programm ``basteln'' wollen. Wenn du dich damit
|
|
||||||
nicht auskennst, ist das nicht schlimm, es geht um Dateien und nicht um
|
|
||||||
irgendwelche freakigen Sachen.\\
|
|
||||||
Zuerst der Verzeichnisbaum eines ``frischen'' Repos:
|
|
||||||
\begin{alltt}
|
|
||||||
hauke@apollo:~/git/Lara$ tree .
|
|
||||||
.
|
|
||||||
\textbar\textendash\textendash CMakeLists.txt
|
|
||||||
\textbar\textendash\textendash Doxyfile
|
|
||||||
\textbar\textendash\textendash README.md
|
|
||||||
\textbar\textendash\textendash sql
|
|
||||||
\textbar\ \ \textbar\textendash\textendash address.sql
|
|
||||||
\textbar\ \ \(\llcorner\)\textendash\textendash customer.sql
|
|
||||||
\(\llcorner\)\textendash\textendash src
|
|
||||||
\textbar\textendash\textendash addons
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Address
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash AddressAddon.cc
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash AddressAddon.h
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash AddressMainWindow.cc
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash AddressMainWindow.h
|
|
||||||
\textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash CMakeLists.txt
|
|
||||||
\textbar\ \ \(\llcorner\)\textendash\textendash CMakeLists.txt
|
|
||||||
\textbar\textendash\textendash CMakeLists.txt
|
|
||||||
\textbar\textendash\textendash core
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Addon.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Base.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Base.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash CMakeLists.txt
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Config.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Config.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Convert.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Convert.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Database.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Database.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Files.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Files.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash IDatabase.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash IDatabase.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Lara.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Lara.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Loader.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Loader.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Map.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Map.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash models
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash Address.h
|
|
||||||
\textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash Customer.h
|
|
||||||
\textbar\ \ \(\llcorner\)\textendash\textendash UserData.h
|
|
||||||
\textbar\textendash\textendash GUI
|
|
||||||
\textbar\ \ \textbar\textendash\textendash CMakeLists.txt
|
|
||||||
\textbar\ \ \textbar\textendash\textendash MainWindow.cc
|
|
||||||
\textbar\ \ \(\llcorner\)\textendash\textendash MainWindow.h
|
|
||||||
\(\llcorner\)\textendash\textendash main.cc
|
|
||||||
|
|
||||||
7 directories, 39 files
|
|
||||||
\end{alltt}
|
|
||||||
Ein ``git status'' s"ahe so aus:
|
|
||||||
\begin{verbatim}
|
|
||||||
hauke@apollo:~/git/Lara$ git status
|
|
||||||
Auf Branch develop
|
|
||||||
Ihr Branch ist auf dem selben Stand wie 'origin/develop'.
|
|
||||||
nichts zu committen, Arbeitsverzeichnis unverändert
|
|
||||||
hauke@apollo:~/git/Lara$
|
|
||||||
\end{verbatim}
|
|
||||||
|
|
||||||
Um dieses Projekt zu compilieren, muss ich folgende Schritte
|
|
||||||
durchf"uhren:
|
|
||||||
\begin{itemize}
|
|
||||||
\item mkdir build
|
|
||||||
\item cd build
|
|
||||||
\item cmake ../
|
|
||||||
\item make
|
|
||||||
\end{itemize}
|
|
||||||
Das heisst, ich erzeuge ein neues Verzeichnis namens ``build'',
|
|
||||||
wechsele in das dortige Verzeichnis, f"uhre ein wenig Magie aus
|
|
||||||
und am Ende f"allt das fertige Programm im Unterverzeichnis ``src''
|
|
||||||
raus.\\
|
|
||||||
Wenn ich das alles gemacht habe, sieht der Verzeichnisbaum so aus:
|
|
||||||
\begin{alltt}
|
|
||||||
.
|
|
||||||
\textbar\textendash\textendash build
|
|
||||||
\textbar\ \ \textbar\textendash\textendash CMakeCache.txt
|
|
||||||
\textbar\ \ \textbar\textendash\textendash CMakeFiles
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash 2.8.12.2
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash CMakeCCompiler.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash CMakeCXXCompiler.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash CMakeDetermineCompilerABI\_C.bin
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash CMakeDetermineCompilerABI\_CXX.bin
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash CMakeSystem.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash CompilerIdC
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash a.out
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash CMakeCCompilerId.c
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash CompilerIdCXX
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash a.out
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash CMakeCXXCompilerId.cpp
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash cmake.check\_cache
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash CMakeDirectoryInformation.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash CMakeOutput.log
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash CMakeTmp
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash Makefile2
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash Makefile.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash progress.marks
|
|
||||||
\textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash TargetDirectories.txt
|
|
||||||
\textbar\ \ \textbar\textendash\textendash cmake\_install.cmake
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Makefile
|
|
||||||
\textbar\ \ \(\llcorner\)\textendash\textendash src
|
|
||||||
\textbar\ \ \textbar\textendash\textendash addons
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash Address
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash address.so
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash CMakeFiles
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash address.dir
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash AddressAddon.cc.o
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash AddressMainWindow.cc.o
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash build.make
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash cmake_clean.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash CXX.includecache
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash DependInfo.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash depend.internal
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash depend.make
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash flags.make
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash link.txt
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash progress.make
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash CMakeDirectoryInformation.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash progress.marks
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash cmake\_install.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash Makefile
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash CMakeFiles
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash CMakeDirectoryInformation.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash progress.marks
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash cmake\_install.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash Makefile
|
|
||||||
\textbar\ \ \textbar\textendash\textendash CMakeFiles
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash CMakeDirectoryInformation.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash lara.dir
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash build.make
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash cmake\_clean.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash core
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash Base.cc.o
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash Config.cc.o
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash Convert.cc.o
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash Database.cc.o
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash Files.cc.o
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash IDatabase.cc.o
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash Lara.cc.o
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash Loader.cc.o
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash Map.cc.o
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash CXX.includecache
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash DependInfo.cmake
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash depend.internal
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash depend.make
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash flags.make
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash GUI
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash MainWindow.cc.o
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash link.txt
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \textbar\textendash\textendash main.cc.o
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash progress.make
|
|
||||||
\textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash progress.marks
|
|
||||||
\textbar\ \ \textbar\textendash\textendash cmake\_install.cmake
|
|
||||||
\textbar\ \ \textbar\textendash\textendash lara
|
|
||||||
\textbar\ \ \(\llcorner\)\textendash\textendash Makefile
|
|
||||||
\textbar\textendash\textendash CMakeLists.txt
|
|
||||||
\textbar\textendash\textendash Doxyfile
|
|
||||||
\textbar\textendash\textendash README.md
|
|
||||||
\textbar\textendash\textendash sql
|
|
||||||
\textbar\ \ \textbar\textendash\textendash address.sql
|
|
||||||
\textbar\ \ \(\llcorner\)\textendash\textendash customer.sql
|
|
||||||
\(\llcorner\)\textendash\textendash src
|
|
||||||
\textbar\textendash\textendash addons
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Address
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash AddressAddon.cc
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash AddressAddon.h
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash AddressMainWindow.cc
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash AddressMainWindow.h
|
|
||||||
\textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash CMakeLists.txt
|
|
||||||
\textbar\ \ \(\llcorner\)\textendash\textendash CMakeLists.txt
|
|
||||||
\textbar\textendash\textendash CMakeLists.txt
|
|
||||||
\textbar\textendash\textendash core
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Addon.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Base.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Base.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash CMakeLists.txt
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Config.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Config.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Convert.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Convert.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Database.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Database.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Files.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Files.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash IDatabase.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash IDatabase.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Lara.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Lara.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Loader.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Loader.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Map.cc
|
|
||||||
\textbar\ \ \textbar\textendash\textendash Map.h
|
|
||||||
\textbar\ \ \textbar\textendash\textendash models
|
|
||||||
\textbar\ \ \textbar\ \ \textbar\textendash\textendash Address.h
|
|
||||||
\textbar\ \ \textbar\ \ \(\llcorner\)\textendash\textendash Customer.h
|
|
||||||
\textbar\ \ \(\llcorner\)\textendash\textendash UserData.h
|
|
||||||
\textbar\textendash\textendash GUI
|
|
||||||
\textbar\ \ \textbar\textendash\textendash CMakeLists.txt
|
|
||||||
\textbar\ \ \textbar\textendash\textendash MainWindow.cc
|
|
||||||
\textbar\ \ \(\llcorner\)\textendash\textendash MainWindow.h
|
|
||||||
\(\llcorner\)\textendash\textendash main.cc
|
|
||||||
|
|
||||||
23 directories, 103 files
|
|
||||||
\end{alltt}
|
|
||||||
|
|
||||||
Du siehst den Unterschied!\\
|
|
||||||
|
|
||||||
Git w"urde jetzt also alle ``neuen'' Datein unterhalb von build finden
|
|
||||||
und nat"urlich daraus schliessen, dass man diese auch ins Repo
|
|
||||||
aufnehmen will:
|
|
||||||
\begin{verbatim}
|
|
||||||
Auf Branch develop
|
|
||||||
Ihr Branch ist auf dem selben Stand wie 'origin/develop'.
|
|
||||||
Unversionierte Dateien:
|
|
||||||
(benutzen Sie "git add <Datei>...", um die Änderungen zum Commit vorzumerken)
|
|
||||||
|
|
||||||
build/
|
|
||||||
|
|
||||||
keine Änderungen zum Commit vorgemerkt (benutzen Sie "git add" und/oder "git commit -a")
|
|
||||||
\end{verbatim}
|
|
||||||
|
|
||||||
Nein! Will man nicht!\\
|
|
||||||
Man h"atte jetzt den ganzen unn"utzen ``M"ull'' f"ur eine bestimmte
|
|
||||||
Plattform und das ist nicht Sinn eines Quellcode Repositories.\\
|
|
||||||
Ergo m"ussen wir daf"ur sorgen, dass git nicht nervt, wenn wir auf
|
|
||||||
unserem Rechner das Programm bauen wollen. Dazu soll git also das
|
|
||||||
gesamte Verzeichnis ``build'', mit allen Dateien und Unterverzeichnissen
|
|
||||||
ignorieren.\\
|
|
||||||
Dazu erstellen wir im Hauptverzeichnis unseres Repos die Datei
|
|
||||||
``.gitignore'' (man beachte den Punkt vor dem Dateinamen). Die
|
|
||||||
sieht dann so aus:
|
|
||||||
\begin{verbatim}
|
|
||||||
build/
|
|
||||||
\end{verbatim}
|
|
||||||
|
|
||||||
Wenn wir jetzt ``git status'' machen, sieht das so aus:
|
|
||||||
\begin{verbatim}
|
|
||||||
Auf Branch develop
|
|
||||||
Ihr Branch ist auf dem selben Stand wie 'origin/develop'.
|
|
||||||
nichts zu committen, Arbeitsverzeichnis unverändert
|
|
||||||
\end{verbatim}
|
|
||||||
|
|
||||||
Cool! Genau das, was wir haben wollen! Das Verzeichnis ``build'' wird
|
|
||||||
von git ignoriert.\\
|
|
||||||
\\
|
|
||||||
Ein weiteres Beispiel:\\
|
|
||||||
Unter MacOS wird gerne die Datei ``.DS\_Store'' angelegt. Da diese
|
|
||||||
Datei f"ur Nutzer anderer Systeme uninteressant, ja sogar nervig
|
|
||||||
ist, sollte man also, wenn Maccies mit im Team sind, in die
|
|
||||||
.gitignore die Datei aufnehmen. Dann sieht also die .gitignore
|
|
||||||
f"ur unser C++-Projekt so aus:
|
|
||||||
\begin{verbatim}
|
|
||||||
build/
|
|
||||||
.DS_Store
|
|
||||||
\end{verbatim}
|
|
||||||
|
|
||||||
Je nach Projekt, Programmiersprache, verwendetem Editor, oder
|
|
||||||
verwendeter IDE gibt es noch weitere Dateien, die f"ur andere
|
|
||||||
uninteressant oder unwichtig sind. Diese k"onnen dann nach
|
|
||||||
und nach in die .gitignore aufgenommen werden, wobei nat"urlich
|
|
||||||
auch Wildcards verwendet werden k"onnen.
|
|
||||||
|
|
||||||
\chapter{GIT in IDEs}
|
|
||||||
Die meisten IDEs bringen inzwischen Unterst"utzung f"ur GIT mit.\\
|
|
||||||
|
|
||||||
\section{Geany}
|
|
||||||
Geany ist eine kleine, erweiterbare IDE, die kostenlos f"ur diverse
|
|
||||||
Plattformen angeboten wird.\\
|
|
||||||
Mit Hilfe eines Plugins kann die Verbindung zu GIT installiert werden.
|
|
||||||
Nach der Aktivierung des Plugins steht dann unter dem Menü ``Werkzeuge''
|
|
||||||
der Eintrag ``Versionskontrolle'' zur Verfügung. Hier kann dann
|
|
||||||
GIT für die zur Zeit bearbeitete Datei oder für das gesamte Projektverzeichnis
|
|
||||||
verwendet werden.\\
|
|
||||||
\\
|
|
||||||
\textbf{Tip:}\\
|
|
||||||
Geany legt individuelle Projektdateien in einem eigenen Verzeichnis an.
|
|
||||||
Dies sollte, wenn möglich, nicht im Verzeichnis des GIT-Repos liegen, da
|
|
||||||
es sonst Probleme mit anderen Teammitgliedern geben kann!
|
|
||||||
|
|
||||||
\section{NetBeans}
|
|
||||||
NetBeans ist eine recht verbreitete IDE, die kostenlos f"ur diverse
|
|
||||||
Plattformen angeboten wird.\\
|
|
||||||
Die Verbindung von NetBeans zu GIT kann "uber ein Plugin ggf.
|
|
||||||
nachinstalliert werden.\\
|
|
||||||
Startet man NetBeans, hat man unter Team->Git die M"oglichkeit,
|
|
||||||
GIT-Repos zu verwenden.\\
|
|
||||||
Als Beispiel verwende ich nun das Repository unter
|
|
||||||
https://github.com/hauke68/LibTgBotPP, das jedoch das C-/C++-Plugin
|
|
||||||
voraussetzt.\\
|
|
||||||
Um dies anonym auszuchecken und in ein NetzBeans-Projekt zu packen,
|
|
||||||
geht man wie folgt vor:\\
|
|
||||||
Unter Team->Git->Clone wird die obige URL eingetragen. Benutzer
|
|
||||||
und Passwort bleiben leer. Im n"achsten Schritt kann man die
|
|
||||||
Zweige ausw"ahlen, die ausgecheckt werden sollen. Ich empfehle,
|
|
||||||
erst einmal alle auszuchecken. Im dritten Schritt lassen wir alles
|
|
||||||
so, wie es ist.\\
|
|
||||||
Ist alles ordnugsgem"a"s ausgecheckt, sollten wir im Git Repository
|
|
||||||
Browser bereits das GIT-Repo sehen. Nun fehlt noch das NetBeans-Projekt.\\
|
|
||||||
Dazu auf File->New Project klicken und ein neues C-/C++-Projekt anlegen.
|
|
||||||
Dabei darauf achten, dass im Fenster ``Projects'' ``C/C++ Project with
|
|
||||||
existing sources'' ausgew"ahlt ist. Im zweiten Schritt w"ahlen wir
|
|
||||||
das Verzeichnis aus, in dem die Quellen des Repos sind. Das ist nat"urlich
|
|
||||||
das vorhin erzeugte Verzeichnis vom GIT-Repo.\\
|
|
||||||
Da das hier nur ein Beispiel ist, w"ahlen wir als Configuration Mode
|
|
||||||
``custom'' aus. Jetzt nur noch auf ``Next'' klicken, bis nur noch
|
|
||||||
``Finish'' m"oglich ist. Voila, das NetBeans-Projekt existiert und
|
|
||||||
man kann auch GIT als Versionskontrollsystem verwenden.\\
|
|
||||||
Wenn du nun eine Datei l"adst, "anderst und speicherst, kannst du
|
|
||||||
unter ``Team'' sehen, dass es mehr Auswahlm"oglichkeiten in Bezug
|
|
||||||
auf GIT gibt.\\
|
|
||||||
Spiele hier einfach mal ein wenig rum. Da du das Repo anonym
|
|
||||||
ausgecheckt hast, kannst du nichts kaputt machen. Etwas anderes
|
|
||||||
w"are es nat"urlich, wenn du unser Einstiegsprojekt ``Welt'' mit
|
|
||||||
Hilfe von NetBeans bearbeiten willst. Ich wei"s aber nicht, in
|
|
||||||
welche Kategorie dieses ``Projekt'' f"allt.\\
|
|
||||||
\\
|
|
||||||
\textbf{Tip:}\\
|
|
||||||
Da NetBeans im Verzeichnis des Quellcodes gerne das Verzeichnis ``nbproject''
|
|
||||||
anlegt, sollte dies in die .gitignore aufgenommen werden, das es sonst
|
|
||||||
zu Konflikten mit dem nbproject anderer Teammitglieder kommen kann.
|
|
||||||
Noch besser w"are es, nbproject ganz woanders hin auszulagern (Zum
|
|
||||||
Beispiel in das eigene Benutzerverzeichnis).
|
|
||||||
|
|
||||||
\chapter{Zum Ende noch ein paar Ideen und Worte}
|
\chapter{Zum Ende noch ein paar Ideen und Worte}
|
||||||
Zum Ende hin noch ein paar Anregungen bzgl. der Einsatzzwecke
|
Zum Ende hin noch ein paar Anregungen bzgl. der Einsatzzwecke
|
||||||
von GIT.\\
|
von GIT.\\
|
||||||
|
Loading…
Reference in New Issue
Block a user