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

Minor changes to slides

parent f629203b
No related branches found
No related tags found
No related merge requests found
......@@ -3,8 +3,8 @@
* `clone` a repository, do not download the `.zip` file.
* `pull` before `push`
* Work on your **own** branch (in your own fork)
* Do **not** `push` to `master` or `develop` (submit PR)
* Get your code reviewed by submitted a PR
* Do **not push** to `master` or `develop`, but **submit a PR**
* Get your code **reviewed** by your peers (submit a PR!)
* Do **not** combine `git` commands
```sh
$ git commit -am "myMessage" # do not do this
......@@ -15,9 +15,8 @@ $ git add myFile.txt
```
* Commit only a few files at once
* Submit a PR instead of pushing directly
* Always sync your fork before starting to work
* Commit **only a few files** at once (after multiple separate `git add` commands)
* Always **sync your fork** before starting to work
```sh
$ git remote -v # verify to have the right remote set
$ git fetch upstream
......@@ -27,4 +26,4 @@ $ git push origin master # do not do git push (!)
* `Push` often - avoid conflicts
<br><br>
**A `push` a day keeps the conflict away**
Remember: **A `push` a day keeps conflicts away!**
......@@ -9,13 +9,34 @@ The master branch:
## One branch per feature
Assume that you want to work on a function for a matrix-vector operation.
```shell
```sh
$ git checkout -b matrix_vect_mult_myName
# creates the branch locally
```
The `-b` flag creates the branch.
<img src="img/branch-create.png" class="branch-create" />
Push the branch to the remote repository
```sh
$ git push
```
If you do that, `git` will complain
```sh
fatal: The current branch matrix_vect_mult_myName has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin matrix_vect_mult_myName
```
<br>
Follow the advice and do:
```sh
$ git push --set-upstream origin matrix_vect_mult_myName
```
## Switch between branches
......@@ -23,7 +44,7 @@ In your terminal, you may see the name of the branch you are on.
List available branches of the repository
```sh
$ git branch
$ git branch --list
```
<div class="fragment">
......@@ -35,7 +56,7 @@ $ git checkout <branch_name>
<div class="fragment">
<br>
You can switch back to master with
You can switch back to the `master` branch with
```sh
$ git checkout master
```
......@@ -60,7 +81,7 @@ Use the **interface** to make use of your peers to review your code!
<img src="img/branch-merge.png" class="branch-merge" />
<br>
You can delete the branch via the interface.
Once merged, you can delete the branch via the interface.
## Gitlab interface
......
......@@ -5,7 +5,7 @@ You **fork** when you want to work on a public repository or a protected reposit
Remember:
- A **fork** is your own **copy** of a repository.
- A **fork** can have multiple **branches**
- A **fork** can have multiple **branches**.
- A **fork** is not a **branch**, but can have multiple **branches**.
......@@ -32,7 +32,7 @@ $ cd forkMyRepo
## Add the address of the original repository
Add the `upstream` (where you copied from)
Add the `upstream` address (original/protected repository)
```sh
$ git remote add upstream https://git-r3lab.uni.lu/origGroup/origRepo.git
```
......
......@@ -9,8 +9,12 @@ Positive point: GitHub and GitLab are (almost) the same.
## GitHub (Live Demo)
[www.github.com](www.github.com)
## GitLab (Live Demo)
[https://git-r3lab.uni.lu](https://git-r3lab.uni.lu)
## Open an issue (Live Demo)
## The Linux Terminal
## The Terminal (shell)
Starting the terminal presents itself with a line where you can enter a command:
```sh
......@@ -13,8 +13,8 @@ $
```
<br>
When you open your terminal (git shell) and unless otherwise configured, you are located
in your home directory, denoted as `~/`.
When you open your terminal (shell), you are located
in your home directory (unless otherwise configured), denoted as `~/`.
## Essential Linux commands
......@@ -36,7 +36,10 @@ $ cd myDirectory
Change the directory 1 level and 2 levels up
```sh
$ cd ..
# 1 level up
$ cd ../..
# 2 levels up
```
......
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