To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 8db6ed24 authored by Oscan Openness's avatar Oscan Openness

add slides for intro to local repos

parent dbd5aedc
......@@ -21,7 +21,118 @@
class: center, middle
# My Awesome Presentation
# Collaboration with git & Gitlab
---
# Why to use _git_
<img src="images/xkcd_git.png" width="300">
---
# How to use _git_
- installing
- work local
- change & track
---
# Installing _git_
Download *git* for your operating system from [https://git-scm.com/downloads](https://git-scm.com/downloads)
---
# Creating a local repository
open your `Git-Bash`
create a new directory
```bash
mkdir mywebsite
```
change into that directory
```bash
cd mywebsite
```
turn this folder into a git repository
```bash
git init
```
---
# Checking your local repository
you check the status of your repository using
```bash
git status
```
which should give you
```bash
On branch master
No commits yet
nothing to commit (create/copy files and use "git add" to track)
```
---
# Change something & commit it
In your folder `mywebsite` create a file `helloworld.html` with the conent
```html
<html>
<body>
<h1>Hello World!</h1>
</body>
</html>
```
check how git sees that file
```bash
git status
```
which tells you that there are
```bash
No commits yet
Untracked files:
(use "git add <file>..." to include in what will be committed)
helloworld.html
nothing added to commit but untracked files present (use "git add" to track)
```
---
# Change something & commit it
so let's follow the advice and do
```bash
git add helloworld.html
```
and then **commit** this change
```bash
git commit -m 'add my first file'
```
you can always check everything you did with
```bash
git log
```
```bash
commit 3b5616d1ba962e7a2e4af1f1bdd54f5d65d4e22d (HEAD -> master)
Author: Oscan Openness <dini_mueter@gmx.net>
Date: Sun Jan 12 12:20:28 2020 +0100
add my first file
```
---
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment