Commit 316ceef6 authored by Sylvain Arreckx's avatar Sylvain Arreckx
Browse files

new slides.

parent 5fde3f5c
......@@ -12,27 +12,20 @@
* `clone` a repository, do not download the `.zip` file.
* Do **not** combine `git` commands
```bash
$ git commit -am "myMessage" # do not do this
```
* Stage only 1 file at once using
```bash
$ git add myFile.txt
```
* Commit **only a few files** at once (after multiple separate `git add` commands)
* Always **sync your fork** before starting to work on a new branch
```bash
$ git remote -v # verify to have the right remote set
$ git fetch upstream
$ git merge upstream/master
$ git push origin master # do not do git push (!)
```
* `Push` often - avoid conflicts
<br><br>
......
......@@ -84,36 +84,6 @@ Use the **interface** to make use of your peers to review your code!
Once merged, you can delete the branch via the interface.
## Gitlab interface
<img src="https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo.png" alt="GitLab" style="width: 100px;"/>
Detailed information is on [docs.gitlab.com/ce/gitlab-basics/add-merge-request.html](https://docs.gitlab.com/ce/gitlab-basics/add-merge-request.html).
1. Click on **New merge request**
![New Merge Request](https://docs.gitlab.com/ee/gitlab-basics/img/merge_request_new.png)
<br><br>
2. Compare the branches
![Compare branches](https://docs.gitlab.com/ee/gitlab-basics/img/merge_request_select_branch.png)
<ol start="3">
<li>Assign your peer
<br>
![Assigning a peer](https://gitlab.com/gitlab-org/gitlab-ce/uploads/6445f80f96d8cb85b320322d36d8bb0e/assigneesidebar.png)
</li>
</ol>
<ol start="4">
<li>Submit the MR
![Submit MR](https://docs.gitlab.com/ee/gitlab-basics/img/merge_request_page.png)</li>
</ol>
## Github interface
<img src="https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub" style="width: 100px;"/>
......
......@@ -36,6 +36,15 @@ $ git status
```
## Be safe and create a new branch
(more on branches in a few minutes)
<br><br><br><br><br>
```bash
$ git checkout -b matrix_vect_mult_myName
```
## Modify a file
Modify and rename `addTwoNumbers.m` in the folder `firstCommit`
......@@ -81,7 +90,7 @@ $ git add firstCommit/addTwoNumbers_myName.m
```bash
$ git diff
```
exit with `:q`
exit with `q`
## Add a commit message
......@@ -112,10 +121,6 @@ $ git log
```
exit by typing `q`
<div class="fragment">
<br><br>
You just pushed to `master`. This is **not a good** practice (more later!).
## Do it yourself
......
......@@ -21,5 +21,3 @@ Positive point: GitHub and GitLab are (almost) the same.
[https://git-r3lab.uni.lu](https://git-r3lab.uni.lu)
<br><img src="https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-extra-whitespace.png" alt="GitLab" style="width: 200px;"/>
## Open an issue (Live Demo)
......@@ -73,7 +73,7 @@ $ git clone https://github.com/userName/myRepo.git myRepo
<br>
Clone the training repository with
```bash
$ git clone https://git-r3lab.uni.lu/git-training/practice.git practice
$ git clone https://github.com/uni-lu/practice.git practice
```
<br>
You may be prompted to enter your credentials.
......
......@@ -58,11 +58,5 @@
"attr": {
"data-background": "../img/whiteBG.jpg"
}
},
{
"filename": "ready.md",
"attr": {
"data-background": "../img/whiteBG.jpg"
}
}
]
......@@ -11,6 +11,17 @@
<div align="left"><small>[1] *https://en.wikipedia.org/wiki/Git*</small></div>
## Funny story
![](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**
......
Supports Markdown
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