Skip to content
Snippets Groups Projects
Commit 659c2d51 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

Merge branch 'theme-draft' into develop

parents 2dc1e8d9 780aa5a8
No related branches found
No related tags found
No related merge requests found
Showing with 4 additions and 369 deletions
File deleted
File deleted
slides/img/graffle/fork.graffle/image1.tiff

1.75 MiB

slides/img/graffle/fork.graffle/image2.tiff

257 KiB

slides/img/icon-live-demo.png

43.4 KiB

slides/img/installation.png

32.8 KiB

slides/img/sbgBackgroundWhite.jpg

470 KiB

slides/img/whiteBG.jpg

42.7 KiB

## Installation of `git`
<img src="img/github_app.png" class="as-is" height="200" />
**macOS**
Install *Xcode Command Line Tools*
<br>
**Windows**
Install Git Bash: <br>`https://git-scm.com/download/win`
<br>
**Linux (Ubuntu)**
```bash
$ sudo apt-get install git-all
```
## How to get started?
**macOS**
Start the `Terminal` or `iTerm`.
<br>
**Windows**
Start `GUI Bash`.
<br>
**Linux (Ubuntu)**
Start the `Terminal` or `Terminator`.
## Is `git` properly installed?
```bash
$ git --version
# git version 2.10.0
```
\ No newline at end of file
......@@ -9,89 +9,6 @@
"attr": {
}
},
{
"filename": "the_terminal.md",
"attr": {
}
},
{
"filename": "the_editor.md",
"attr": {
}
},
{
"filename": "what_is_git.md",
"attr": {
}
},
{
"filename": "installation.md",
"attr": {
}
},
{
"filename": "github_gitlab.md",
"attr": {
}
},
{
"filename": "configuration.md",
"attr": {
}
},
{
"filename": "cloneRepo.md",
"attr": {
}
},
{
"filename": "forks.md",
"attr": {
}
},
{
"filename": "branches.md",
"attr": {
}
},
{
"filename": "essential_commands.md",
"attr": {
}
},
{
"filename": "merge.md",
"attr": {
}
},
{
"filename": "syncFork.md",
"attr": {
}
},
{
"filename": "best_practices.md",
"attr": {
}
},
{
"filename": "homework.md",
"attr": {
}
},
{
"filename": "thanks.md",
"attr": {
......
## Pull and merge requests
If you want your changes to be reflected on the `develop` or `master` branches,
**submit a MR or a PR** via the Github/Gitlab interface.
<br>
Use the **interface** to make use of your peers to review your code!
<img src="img/branch-merge.png" class="branch-merge" />
<br>
Once merged, you can delete the branch via the interface.
<div class="fragment">
<br>
<img src="img/icon-live-demo.png" height="100px">
\ No newline at end of file
## Overview
0. The terminal
1. The editor
2. What is `git`? What is the use of `git`? <!--(5 min)//-->
3. Installation of `git`
4. GitHub and GitLab <!--(5min)//-->
5. How do I configure `git`? <!--(5min)//-->
6. Where and how to start <!--(5min)//-->
7. What is a fork? <!--(5min)//-->
8. What are branches?
9. The 5 essential commands <!--(10 min)//-->
* `pull` / `status` / `add` / `commit` / `push`
10. What are merge/pull requests? <!--(10 min)//-->
11. How do I synchronize my fork?
12. Best practices
\ No newline at end of file
0. Subject 1
1. Subject 2
\ No newline at end of file
## Synchronize your fork
![bulb](img/bulb.png) Remember, we have to regularly update our own copy of the code.
## Add the address of the original repository
Add the `upstream` address (original/protected repository)
```bash
$ git remote add upstream ssh://git@git-r3lab-server.uni.lu:8022/R3school/
git.practice.git
```
![bulb](img/bulb.png) Note the change in the URL.
<br>
You can then check whether the remote address is set correctly
```bash
$ git remote -v
```
<div class="fragment">
<br>
Fetch the changes from upstream (similar to pull)
```bash
$ git fetch upstream
```
<div class="fragment">
<br>
Merge the retrieved changes on the `master` branch:
```bash
$ git checkout master
$ git merge upstream/master
$ git push origin master
```
<div class="fragment">
Do the same for the `develop` branch.
<img src="img/icon-live-demo.png" height="100px">
\ No newline at end of file
### Let's refresh our memories
<div class="fragment">
<br>
- What is a **fork**?
<div class="fragment">
<br>
- What are **branches**?
<div class="fragment">
<br>
- Can I have **multiple branches** in my fork?
<div class="fragment">
<br>
- What is a good **development scheme**?
<div class="fragment">
<br>
- What are the **5 essential commands**?
### References & Cheat sheet
[1]: **Git** Book:
https://git-scm.com/book/en/v2
<br>[2]: GitHub training services: https://services.github.com/training/
<br>[3]: Cheat sheet: http://rogerdudler.github.io/git-guide
## Thank you.
<img src="img/r3-training-logo.png" height="200px">
<center><img src="img/r3-training-logo.png" height="200px"></center>
Contact us if you need help:
r3lab.core@uni.lu
<a href="mailto:r3lab.core@uni.lu">r3lab.core@uni.lu</a>
## The editor
Recommended editors:
- **Visual Studio Code** <br>(https://code.visualstudio.com)
- **Atom** <br>(https://atom.io)
## Visual Studio Code
<br><img src="img/icon-live-demo.png" height="100px">
\ No newline at end of file
## The terminal (shell)
<br>
**UNIX users (macOS & Linux):**
Start the Terminal from your `/Applications` directoy.
![bulb](img/bulb.png) Install iTerm2: `https://www.iterm2.com`
<br>
**Windows users:**
Install Git Bash: <br>`https://git-scm.com/download/win`
<br>
**Linux users:**
Launch default terminal.<br>
![bulb](img/bulb.png) Install Terminator: `https://launchpad.net/terminator`
## First steps in the terminal
Starting the terminal presents itself with a line where you can enter a command
```bash
cesar@myComputer>
```
<div class="fragment">
<br>
Often written, for covenience, as
```bash
$
```
<br>
When you open your terminal (shell), you are located
in your home directory (unless otherwise configured), denoted as `~/`.
## Essential Linux commands
List the contents of a directory
```bash
$ ls #-lash
```
<div class="fragment">
<br>
Create a directory
```bash
$ mkdir myNewDirectory
```
<div class="fragment">
<br>
Change the directory to a specific folder
```bash
$ cd myNewDirectory
```
<br>
Change the directory 1 level and 2 levels up
```bash
$ cd ..
# 1 level up
$ cd ../..
# 2 levels up
```
<div class="fragment">
<br>
Move a file or a directory
```bash
$ mv myFile.m myNewDirectory/.
```
<div class="fragment">
<br>
Rename a file or a directory
```bash
$ mv myFile.m myNewFile.m
$ mv myNewDirectory myDirectory
```
## What is `git`?
<!-- ![](img/git_definition.png) -->
`git` is a **version control system** (VCS) for tracking changes in computer files and coordinating work on those files among multiple people [1].
<br><br><br>Designed and implemented in 2005 by **Linus Torvalds**
![](img/linus.jpg)
<div align="left"><small>[1] *https://en.wikipedia.org/wiki/Git*</small></div>
## The inventor of `git`
![](img/git_definition.png)
<br><br>
```
I'm an egotistical bastard, and I name all my projects after myself.
First Linux, now git.
```
Linus Torvald (2007-06-14)
## What is the use of `git`?
* No need to fully rewrite code; **reuse code** and **save time**
* Keep the changes you made over time (**history**)
* Allows you to **backtrack** (if necessary) and undo unwanted changes
* Easily **add contributions** of your collaborators to the main code base
note:
Other points to mention:
* git shall not be considered as a nuisance, but as a tool that should help to track and trace the code.
* git is not to track performance. Not using it shows exactly the opposite.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment