From 0a99a8e472fd8242a0d6760e346f303ab82964ac Mon Sep 17 00:00:00 2001 From: Laurent Heirendt <laurent.heirendt@uni.lu> Date: Thu, 12 Jan 2017 19:52:53 +0100 Subject: [PATCH] Updated slides --- essential_commands.md | 25 ++++++++++--------------- forks.md | 39 ++++++++++++++++++++++++--------------- github_gitlab.md | 6 ++++++ index.md | 6 +++++- installation.md | 35 +++++++++++++++++++++++++++++++---- the_terminal.md | 2 +- what_is_git.md | 4 ++-- 7 files changed, 79 insertions(+), 38 deletions(-) diff --git a/essential_commands.md b/essential_commands.md index 15e217d7..2228dd35 100644 --- a/essential_commands.md +++ b/essential_commands.md @@ -1,28 +1,24 @@ ## The 5 essential commands -`pull, status, add, commit, push` - -note: - Put your speaker notes here. - You can see them pressing 's'. - Fullscreen can be activated by typing 'f'. +<br> +**Yes**, you only need 5 commands! +<br> +`pull, status, add, commit, push` +<br> +or in other words (more technically) ```shell -$ git init +$ git pull $ git status -$ git add -$ git diff -$ git commit -$ git log +$ git add myFile.txt +$ git commit -m "myMessage" +$ git push ``` -note: - Voici les commandes que nous allons apprendre ## Nouveau projet : Listes -<div class="fragment"> Créer l'espace de travail ```shell @@ -31,7 +27,6 @@ $ mkdir workspace $ cd workspace ``` -<div class="fragment"> Puis le dossier du nouveau projet ```shell diff --git a/forks.md b/forks.md index 0f6d3469..f38729ca 100644 --- a/forks.md +++ b/forks.md @@ -1,18 +1,9 @@ -## Remote - -Parlons de dépôt *distant* - +## Fork <img src="img/remote-0-master.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_ ```shell @@ -41,12 +32,30 @@ $ git pull origin master # Récupérer le travail Terminologie de l'application GitHub -## Conflits +## Avoid conflicts +Good practice: -## Pull Requests -Ou comment utiliser GitHub pour vos revues de code +<large>**PULL**</large> before you **push**! + +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 -Contribuez à l'open source +Keep your fork up-to-date +```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) diff --git a/github_gitlab.md b/github_gitlab.md index 683c6757..5c42c0d4 100644 --- a/github_gitlab.md +++ b/github_gitlab.md @@ -11,3 +11,9 @@ Positive point: GitHub and GitLab are (almost) the same. ## GitLab + + + +## Good practices + +Always `clone` a repository, do not download the `.zip` file. diff --git a/index.md b/index.md index 8043af62..8f0015ed 100644 --- a/index.md +++ b/index.md @@ -1,6 +1,6 @@ <img src="img/Git-Logo-Black.png" class="as-is" height="100px">training <br><br> -**SBG and MSP groups** +**SBG & MSP groups** <img src="img/logoLCSB.png" class="as-is" height="100px"> @@ -46,3 +46,7 @@ PR, issues (on a dummy test repo) - Task 2: Push to forked repo and create a PR - Bonus Task: Fork the cobratoolbox and update - Friday: 1h debriefing + + Put your speaker notes here. + You can see them pressing 's'. + Fullscreen can be activated by typing 'f'. diff --git a/installation.md b/installation.md index 564957dc..eb1e1f92 100644 --- a/installation.md +++ b/installation.md @@ -26,19 +26,19 @@ Follow instructions on *[git-for-windows.github.io](https://git-for-windows.gith **Linux (Ubuntu)** and **macOS** -Start the terminal +Start the terminal (or any other shell) + <br> **Windows** -Start `GUI Bash` or, if installed, `MobaXTerm`. +Start `GUI Bash` or `MobaXTerm`. -## Configuration +## How to configure `git`? ```shell $ git config --global user.name "Firstname Lastname" $ git config --global user.email "first.last@uni.lu" -$ git config -l ``` @@ -48,3 +48,30 @@ $ git config -l $ git --version # 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**! diff --git a/the_terminal.md b/the_terminal.md index 10b5da92..a53ce9b1 100644 --- a/the_terminal.md +++ b/the_terminal.md @@ -2,7 +2,7 @@ Starting the terminal presents itself with a line where you can enter a command: ```sh -michael@myComputer> +cesar@myComputer> ``` Often written, for covenience, as: ```sh diff --git a/what_is_git.md b/what_is_git.md index 4f0f6b5d..44347eed 100644 --- a/what_is_git.md +++ b/what_is_git.md @@ -2,10 +2,10 @@  +`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**  -`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> -- GitLab