Git is free, open-source software for managing small to large projects. It is used to manage projects on a version-based basis.
This should be understood as a tutorial with the most common commands. Test and try out the commands and their handling in small test scenarios BEFORE you start working on production systems!
Installation on Windows
The Windows Git client Git for Windows can be downloaded from https://gitforwindows.org/. Normally, it can be installed in the default folder.

We recommend using TortoiseGit (see below) as a graphical interface for Git on Windows. If you want to use it, you can deselect the Git GUI Here option in the installer.

If you want to use a specific editor (e.g. Notepad++), you can configure this here.

If there is no specific reason for you to change the following setting, the default is recommended.

Installation under Linux
On most Linux distributions, the Git client can be easily installed via the package manager.
Apt-based systems
e.g. Debian, Raspbian, Ubuntu, etc.
# apt install git
Yum-based systems
e.g. Red Hat, Fedora, CentOS, etc.
# yum install git
Compiling the source code yourself
If necessary, the source code can also be compiled and installed yourself – simple instructions for this can be found at:
Installing Git from git-scm.com:https://git-scm.com/book/de/v2/Erste-Schritte-Git-installieren
Use in the command line
Without any additional tools or IDE integration, Git can be easily used via the command line of the respective operating system. For example, Command Prompt, PowerShell or Git Bash on Windows (installed by the Git for Windows installer) or Bash on Linux. ## Setup before first use If Git has never been used on the computer before, it is necessary to configure the global user and their email address.
$ git config --global user.name ‘[My User Name]’
$ git config --global user.email ‘[User @ Mailserver . TLD]’
The square brackets and their contents must be replaced accordingly. For example
$ git config --global user.name ‘Melanie Amirah’
$ git config --global user.email ‘melanie.amirah@unileoben.ac.at’
Checking out a repository that exists on the server
The clone command can be used to retrieve an existing repository, creating a local copy in the process.
$ git clone [repository URL]
The square brackets and their contents must be replaced accordingly. For example
$ git clone https://git.unileoben.ac.at/howto/git
Pushing a local directory to a repository
First, use the cd command to change to the appropriate directory. Then The init command is used to create a local repository for an existing directory. To upload this to a server, add the appropriate server with remote add, add the relevant files with add, combine them into a package with commit, and finally transfer them to the server with push.
cd my_gitlab_documentation
git init
git remote add origin https://git.unileoben.ac.at/howto/git
git add .
git commit -m ‘Initial commit’
git push -u origin master
Git with Windows Explorer extension (TortoiseGit)
TortoiseGit (https://tortoisegit.org/) is a very easy-to-use extension for Windows Explorer that allows you to use Git without the command line.

Check out a repository that exists on the server

Mit Git Clone… kann ein bestehendes Repository abgerufen werden - © ICT und Digitalisierung Montanuniversität Leoben







