diff --git a/slides/best_practices.md b/slides/best_practices.md index 91ca870bd5f3e722ad31083ca18c0647ade7272a..bafee3744301cfe7ccc85b7288adc50c006581b1 100644 --- a/slides/best_practices.md +++ b/slides/best_practices.md @@ -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> diff --git a/slides/branches.md b/slides/branches.md index 6a5eaf044bf1ff09a5d205418c3f68111c45e53f..b00b94f266f617208f63b83987ac1ba564f9ae4d 100644 --- a/slides/branches.md +++ b/slides/branches.md @@ -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** - - -<br><br> -2. Compare the branches - - - - -<ol start="3"> - <li>Assign your peer - <br> - -  - </li> -</ol> - - -<ol start="4"> - <li>Submit the MR - - </li> -</ol> - - ## Github interface <img src="https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub" style="width: 100px;"/> diff --git a/slides/essential_commands.md b/slides/essential_commands.md index 96a4ab9ca888c5f70823a1ba7de289fb4d7c38d9..43bde21dbe1853767cff601bf054f8a2c11dd323 100644 --- a/slides/essential_commands.md +++ b/slides/essential_commands.md @@ -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 diff --git a/slides/github_gitlab.md b/slides/github_gitlab.md index ea5e300d8dee6246fb4012881022f15abd4b9b2e..920ba0e78a611a2495b15bd30d7e2a3f4298be87 100644 --- a/slides/github_gitlab.md +++ b/slides/github_gitlab.md @@ -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) diff --git a/slides/index.md b/slides/index.md index 8f0015edeae3d30d6aa9995a5c0d76de32d6ba29..a80758a691c067be6e29ad8c8525dc8d633fe67a 100644 --- a/slides/index.md +++ b/slides/index.md @@ -1,52 +1,14 @@ -<img src="img/Git-Logo-Black.png" class="as-is" height="100px">training -<br><br> -**SBG & MSP groups** +Absolute Beginners<br> +<img src="img/Git-Logo-Black.png" class="as-is" height="100px"><br>Workshop +<br> <img src="img/logoLCSB.png" class="as-is" height="100px"> <br><br><br><br> -<br><br><br><br> +<br> -January 19th, 2017 +April 12th, 2017 Sylvain Arreckx & Laurent Heirendt <br><br><br><br> - -note: - -(**Tuesday**: verify that everybody has a working computer with git installed) - -Verify that everyone has a GitHub and a Gitlab account - -**Thursday**: interactive session -˜/work/training/cobratoolbox - -1. Git (on GitHub and GitLab) - -Init (git-r3 / graphique) - -clone, add, commit, (diff, log), push and status - -branch, checkout (add commit push on a branch) - -Demo that if pushed to a branch, we will have a conflict -> submit a PR to DEVELOP from own branch to avoid that - -2. Github - -Explain interface - -Fork, update the fork - -PR, issues (on a dummy test repo) - -**Thursday**: Home exercise (30 min) -- Task 1a: Create a function with documentation -- Task 1b: test -- 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/slides/installation.md b/slides/installation.md index e614a8a7d2b0e136b9cf116d27603b23e3865380..315f3d29f757ed85c388d36f1d1c2af0e2896458 100644 --- a/slides/installation.md +++ b/slides/installation.md @@ -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. @@ -86,13 +86,3 @@ Any other rudimentary method such as shall **be avoided**! - -## I need `The COBRAToolbox`? - -Simply `clone` the repository (i.e., retrieve a copy) -```bash -$ git clone https://github.com/opencobra/cobratoolbox.git cobratoolbox -``` - -<br><br> -**Do not** do it right now! Thank you. diff --git a/slides/list.json b/slides/list.json index c4a5b483b652ec759b3f56e43ae11fa3338ba75d..1e09f925c05a840f51a47256af93b944d4e84a5c 100644 --- a/slides/list.json +++ b/slides/list.json @@ -47,12 +47,6 @@ "data-background": "../img/whiteBG.jpg" } }, - { - "filename": "forks.md", - "attr": { - "data-background": "../img/whiteBG.jpg" - } - }, { "filename": "best_practices.md", "attr": { @@ -64,17 +58,5 @@ "attr": { "data-background": "../img/whiteBG.jpg" } - }, - { - "filename": "ready.md", - "attr": { - "data-background": "../img/whiteBG.jpg" - } - }, - { - "filename": "homework.md", - "attr": { - "data-background": "../img/whiteBG.jpg" - } } ] diff --git a/slides/overview.md b/slides/overview.md index e91ed2f0313c6c7d148f6f67b24c7c92fd81f4b8..9968e215c1d92df3c5899f2d6eda305674bdb12d 100644 --- a/slides/overview.md +++ b/slides/overview.md @@ -7,7 +7,4 @@ 4. The 5 essential commands <!--(10 min)//--> * `pull` / `status` / `add` / `commit` / `push` 5. Branches <!--(10 min)//--> -6. Forks <!--(10 min)//--> 7. Best practices -8. Practical session <!--(40 min)//--> -9. Evaluation <!--(10 min)//--> diff --git a/slides/what_is_git.md b/slides/what_is_git.md index 649f5c9462ab97edaa9ebd5ef6514ec9860b3d91..8488d139447b8e405b22b7d15c47f8c467a98bd2 100644 --- a/slides/what_is_git.md +++ b/slides/what_is_git.md @@ -11,6 +11,17 @@ <div align="left"><small>[1] *https://en.wikipedia.org/wiki/Git*</small></div> +## Funny story + + +<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**