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

Updated slides

parent f2da3750
No related branches found
No related tags found
No related merge requests found
## The 5 essential commands ## The 5 essential commands
`pull, status, add, commit, push` <br>
**Yes**, you only need 5 commands!
note:
Put your speaker notes here.
You can see them pressing 's'.
Fullscreen can be activated by typing 'f'.
<br>
`pull, status, add, commit, push`
<br>
or in other words (more technically)
```shell ```shell
$ git init $ git pull
$ git status $ git status
$ git add $ git add myFile.txt
$ git diff $ git commit -m "myMessage"
$ git commit $ git push
$ git log
``` ```
note:
Voici les commandes que nous allons apprendre
## Nouveau projet : Listes ## Nouveau projet : Listes
<div class="fragment">
Créer l'espace de travail Créer l'espace de travail
```shell ```shell
...@@ -31,7 +27,6 @@ $ mkdir workspace ...@@ -31,7 +27,6 @@ $ mkdir workspace
$ cd workspace $ cd workspace
``` ```
<div class="fragment">
Puis le dossier du nouveau projet Puis le dossier du nouveau projet
```shell ```shell
......
## Remote ## Fork
Parlons de dépôt *distant*
<img src="img/remote-0-master.png" class="as-is" /> <img src="img/remote-0-master.png" class="as-is" />
<img src="img/remote-1-remote.png" class="as-is" /> <img src="img/remote-1-remote.png" class="as-is" />
## Héberger un dépôt distant ?
Github (Ou [BitBucket](https://bitbucket.org/))
## Ajouter une _remote_ ## Ajouter une _remote_
```shell ```shell
...@@ -41,12 +32,30 @@ $ git pull origin master # Récupérer le travail ...@@ -41,12 +32,30 @@ $ git pull origin master # Récupérer le travail
Terminologie de l'application GitHub Terminologie de l'application GitHub
## Conflits ## Avoid conflicts
Good practice:
## Pull Requests <large>**PULL**</large> before you **push**!
Ou comment utiliser GitHub pour vos revues de code
Do **not** combine `git` commands
```sh
$ git commit -am "myMessage" # do not do this
```
Verify to have the right remote set on your fork
```sh
$ git remote -v
```
## Fork Keep your fork up-to-date
Contribuez à l'open source ```sh
$ git fetch upstream
$ git merge upstream/master
$ git push origin master # do not do git push (!)
```
## Pull Requests
How to submit a Pull Request (PR)
...@@ -11,3 +11,9 @@ Positive point: GitHub and GitLab are (almost) the same. ...@@ -11,3 +11,9 @@ Positive point: GitHub and GitLab are (almost) the same.
## GitLab ## GitLab
## Good practices
Always `clone` a repository, do not download the `.zip` file.
<img src="img/Git-Logo-Black.png" class="as-is" height="100px">training <img src="img/Git-Logo-Black.png" class="as-is" height="100px">training
<br><br> <br><br>
**SBG and MSP groups** **SBG & MSP groups**
<img src="img/logoLCSB.png" class="as-is" height="100px"> <img src="img/logoLCSB.png" class="as-is" height="100px">
...@@ -46,3 +46,7 @@ PR, issues (on a dummy test repo) ...@@ -46,3 +46,7 @@ PR, issues (on a dummy test repo)
- Task 2: Push to forked repo and create a PR - Task 2: Push to forked repo and create a PR
- Bonus Task: Fork the cobratoolbox and update - Bonus Task: Fork the cobratoolbox and update
- Friday: 1h debriefing - Friday: 1h debriefing
Put your speaker notes here.
You can see them pressing 's'.
Fullscreen can be activated by typing 'f'.
...@@ -26,19 +26,19 @@ Follow instructions on *[git-for-windows.github.io](https://git-for-windows.gith ...@@ -26,19 +26,19 @@ Follow instructions on *[git-for-windows.github.io](https://git-for-windows.gith
**Linux (Ubuntu)** and **macOS** **Linux (Ubuntu)** and **macOS**
Start the terminal Start the terminal (or any other shell)
<br> <br>
**Windows** **Windows**
Start `GUI Bash` or, if installed, `MobaXTerm`. Start `GUI Bash` or `MobaXTerm`.
## Configuration ## How to configure `git`?
```shell ```shell
$ git config --global user.name "Firstname Lastname" $ git config --global user.name "Firstname Lastname"
$ git config --global user.email "first.last@uni.lu" $ git config --global user.email "first.last@uni.lu"
$ git config -l
``` ```
...@@ -48,3 +48,30 @@ $ git config -l ...@@ -48,3 +48,30 @@ $ git config -l
$ git --version $ git --version
# git version 2.10.0 # git version 2.10.0
``` ```
## Test the configuration
Test whether your username and email have been registered
```sh
$ git config -l
```
<br>
This should list the configuration with `user.name` and `user.email`.
## I need to get `The COBRAToolbox` - How?
Simply `clone` the repository (i.e., retrieve a copy)
```sh
$ git clone https://github.com/opencobra/cobratoolbox.git cobratoolbox
```
Any other rudimentary method such as
*'I simply download the `.zip` un unzip it - works like a charm!'*
shall **be avoided**!
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Starting the terminal presents itself with a line where you can enter a command: Starting the terminal presents itself with a line where you can enter a command:
```sh ```sh
michael@myComputer> cesar@myComputer>
``` ```
Often written, for covenience, as: Often written, for covenience, as:
```sh ```sh
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
![](img/git_definition.png) ![](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].
Designed and implemented in 2005 by **Linus Torvalds** Designed and implemented in 2005 by **Linus Torvalds**
![](img/linus.jpg) ![](img/linus.jpg)
`git` is a **version control system** (VCS) for tracking changes in computer files and coordinating work on those files among multiple people [1].
<div align="left"><small>[1] *https://en.wikipedia.org/wiki/Git*</small></div> <div align="left"><small>[1] *https://en.wikipedia.org/wiki/Git*</small></div>
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