Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ vm/*.ova
vm/mnt
trainer/
static/
\#*
*~
33 changes: 1 addition & 32 deletions day1/00_Organisation/01_Intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

* Name and Company
* Your role and or daily business
* Any previous experiences with git
* Any previous experiences with Git
* Your expectations for this training

!SLIDE subsection
Expand All @@ -26,8 +26,6 @@
* WiFi is pre-configured
* Exercises use the default terminal

* GitLab App from NWS - nws.netways.de, test account required

!SLIDE smbullets
# BBB Application

Expand All @@ -45,32 +43,3 @@ Click on the link in your email to join the session
* Operating system is CentOS
* We use tmux to join your session and help you
* Change the appearance of the terminal as you like


~~~SECTION:handouts~~~

****


~~~ENDSECTION~~~

!SLIDE smbullets
# Create GitLab app in NWS

* Objective:
* Create a new GitLab app in NWS
* Steps:
* Navigate to https://nws.netways.de and register a trial account if not existing
* Choose Apps > GitLab CE > Basic
* Deploy the app
* Choose `Access` and `Live View` and set a secure password for the `root` user
* Login with `root` and your chosen password
* Wait for the trainer with the Git Basics

~~~SECTION:handouts~~~

****


~~~ENDSECTION~~~

191 changes: 169 additions & 22 deletions day1/01_Introduction/01_Intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
# ~~~SECTION:MAJOR~~~ Git Introduction

!SLIDE smbullets
# Version Control
# Why use Version Control Systems?

* Version Control System (VCS)
* Record changes of file(s)
* Revert changes
* Compare changes over time
* Who, when, what
* Version Control Systems (VCS) track changes over time
* They track who changed what and when
* Changes can be compared, reverted, coordinated with others

Usually VCS are used for source code, text documents, web sites, or other text data.

There are also data VCS for data science or machine learning projects.

~~~SECTION:handouts~~~

Expand All @@ -23,42 +25,187 @@ filesystem structure over time.
Long time ago developers invented version control
systems which store the file revisions in a database.


~~~ENDSECTION~~~

!SLIDE
# Centralized and Distributed VCS

* Central VCS
* A central system contains the *version database*, clients work on this system
* Examples: CVS, Subversion
* Decentral VCS
* Clients mirror the *version database* from a central system and work locally
* Examples: Git, Mercurial

<table>
<tbody>
<tr>
<td><center><img src="../../_images/mermaid/central-vcs.mmd.png" alt="Central VCS"/></center></td>
<td><center><img src="../../_images/mermaid/decentral-vcs.mmd.png" alt="Decentral VCS"/></center></td>
</tr>
</tbody>
</table>

!SLIDE
# The History of Git

Git was developed by the Linux kernel team in 2005.

* They originally used BitKeeper, a closed-source commercial tool
* They created Git due to some controversy with BitKeeper

Their design goals:

* A fully distributed VCS
* Speed (when working with huge numbers of files)
* Simple design
* Non-linear development (branching)

Git has become a de facto standard for version control.

!SLIDE smbullets
# Centralized VCS
# The Git Workfow is local

* Multiple computers required file revisions
* CVS, Subversion
* What happens if the server is down?
In Git we `clone` the data to our local system and work locally.

<center><img src="../../_images/mermaid/central-vcs.mmd.png" alt="Central VCS"/></center>
* No network latency involved as with other VCS systems
* Faster operations due to the local data
* We can work offline and push changes later (i.e. when traveling)

!SLIDE smbullets
# Git Installation

~~~SECTION:handouts~~~
The Git CLI is available for most operating systems.

****
* Linux package are available in most distibutions
* Installers for macOS or Windows
* Many GUI clients are available

Optional shell integrations provide auto-completion and quality-of-life features.

~~~ENDSECTION~~~
<code><span style="color:blue;">training@netways</span> <span style="color:green">~</span>$</span> cd repository</code>

<code><span style="color:blue;">training@netways</span> <span style="color:green">~/repository</span> <span style="color:red">(feature/docs)</span> $</code>

!SLIDE smbullets
# Distributed VCS
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Install Git

* Clients mirror the repository
* Git, Mercurial, Bazaar, etc.
* Server dies, client continues
* Objective:
* Install the `git` package
* Steps:
* Use the package manager to install the git package

<center><img src="../../_images/mermaid/decentral-vcs.mmd.png" alt="Decentral VCS"/></center>
!SLIDE supplemental exercises
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Install Git

~~~SECTION:handouts~~~
## Objective: Install the Git package
****

* Install the `git` package

## Steps:

****

* Use the package manager to install the git package

~~~ENDSECTION~~~
!SLIDE supplemental solutions
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Proposed Solution
****

## Install the Git package

****

### Example for Debian/Ubuntu

@@@ Sh
$ apt-get install git

### Example for RHEL/CentOS

@@@ Sh
$ yum install git

### Example for Fedora

@@@ Sh
$ dnf install git

!SLIDE smbullets small
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Install Git Bash Integration

* Objective:
* Install bash completion and Git status
* Steps:
* Use the package manager to install the `bash-completion` package
* Fetch the `git-prompt.sh` script from https://github.com/git/git - `contrib/completion/git-prompt.sh`
* Customize your prompt in your `$HOME/.bashrc` file

Example:

$ vim $HOME/.bashrc
source ~/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
export PS1='[\u@\h] \W$(__git_ps1 " (%s)") \$ '

$ source $HOME/.bashrc

!SLIDE supplemental exercises
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Install Git Bash Integration

## Objective: Install the Git Bash Integration
****

* Install the `bash-completion` package
* Modify your prompt to highlight the git state

## Steps:

****

* Use the package manager to install the `bash-completion` package
* Fetch the `git-prompt.sh` script from https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
* Customize your prompt
* Persist changes in your .bashrc file

!SLIDE supplemental solutions
# Lab ~~~SECTION:MAJOR~~~.~~~SECTION:MINOR~~~: Proposed Solution
****

## Install Git Bash Integration

****

### Example for Debian/Ubuntu

@@@ Sh
$ apt-get install bash-completion

### Example for RHEL/CentOS

@@@ Sh
$ yum install bash-completion

### Example for Fedora

@@@ Sh
$ dnf install bash-completion

### Fetch the git-prompt.sh script

@@@ Sh
$ wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh

### Customize your prompt in your .bashrc file

Additional configuration settings can be found
in the source code documentation at https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh#L38

@@@ Sh
$ vim $HOME/.bashrc
source ~/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
export PS1='[\u@\h] \W$(__git_ps1 " (%s)") \$ '

$ source $HOME/.bashrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
!SLIDE smbullets
# Git GUI Clients

In this training, we are working with the CLI. For your work
environment, here are a few recommendations for GUI clients:
In this training, we will work with the command-line interface.

These are a few recommendations for graphical clients:

* Sourcetree (Windows, macOS)
* GitKraken (Windows, Linux, macOS)
Expand All @@ -15,9 +16,9 @@ environment, here are a few recommendations for GUI clients:
****

Additional GUI clients can be found here:
https://git-scm.com/download/gui/linux

https://gitextensions.github.io/
* https://git-scm.com/download/gui/linux
* https://gitextensions.github.io/

~~~ENDSECTION~~~

Expand Down Expand Up @@ -74,4 +75,3 @@ Download: https://www.gitkraken.com/
Download: https://desktop.github.com/

~~~ENDSECTION~~~

27 changes: 0 additions & 27 deletions day1/01_Introduction/02_History.md

This file was deleted.

Loading