diff --git a/slides/branches.md b/slides/branches.md index bbfddb58455f71c5bb2044d8f6ce52b772aaf6ad..c80f1ed3258aef12d42147347b251ef2a7b6b1b2 100644 --- a/slides/branches.md +++ b/slides/branches.md @@ -16,7 +16,7 @@ A **version** of the code is referred to as a **branch**. <div class="fragment"> <br><br> -(Live Demo) +<img src="img/icon-live-demo.png" height="100px"> <br> @@ -64,7 +64,9 @@ You can switch to the `develop` branch with $ git checkout develop ``` -(Live Demo) +<div class="fragment"> +<br> +<img src="img/icon-live-demo.png" height="100px"> ## Create your own version @@ -90,5 +92,7 @@ Push your version to your fork: $ git push origin add-2-numbers ``` -<br><br> -(Live Demo) +<br> +<div class="fragment"> +<br> +<img src="img/icon-live-demo.png" height="100px"> diff --git a/slides/configuration.md b/slides/configuration.md index 0802b341a1f3935cf0b104af69c46e7e122a900f..842420df18b5d93f6ecaecedd133d82fbe84fb7d 100644 --- a/slides/configuration.md +++ b/slides/configuration.md @@ -17,17 +17,18 @@ $ git config --list <br> This should list the configuration with `user.name` and `user.email`. +<br> +Exit by typing `q`. + ## What is an SSH key? An SSH key is a secure access credential. - -## Why do I need an SSH key? - +<div class="fragment"> <br> -**Idea**: <br><br> -communicate **securely** with Github/Gitlab **without** entering the username/password. +**Principle**: <br><br> +Communicate **securely** with Github/Gitlab **without** entering the username/password. ## How do I get and set my SSH key? @@ -39,15 +40,17 @@ Check if you already have an SSH key: $ ls -al ~/.ssh ``` <br> -If there is a file with an extension `.pub`, you already have an SSH key. +If there are 2 files named `id_rsa`, you have an SSH key. <div class="fragment"> <br><br> If you don’t have yet an SSH key, you have to generate one: ```bash -$ ssh-keygen -t rsa +$ ssh-keygen -t rsa -b 4096 ``` <br> -Then, add the SSH key to Github/Gitlab (see demo). +Then, add the SSH key to Github/Gitlab. +<div class="fragment"> +<img src="img/icon-live-demo.png" height="100px"> \ No newline at end of file diff --git a/slides/essential_commands.md b/slides/essential_commands.md index 8da014a860cffd4222990bd3eb3bc1ac2f95328b..4f7c47d59e963601c102ad7c417527f4549139d5 100644 --- a/slides/essential_commands.md +++ b/slides/essential_commands.md @@ -17,9 +17,9 @@ $ git push <remote> <branch> ``` -## Pull the latest version of an existing repository +## Pull the latest version of an existing branch -Then, pull the latest revision: +Pull the latest revision on branch `add-2-numbers`: ```bash $ git pull origin add-2-numbers # Already up to date @@ -46,7 +46,7 @@ $ mv addTwoNumbers.m addTwoNumbers_myName.m Open the file using the `Visual Studio Code` editor (or any other editor) and correct the line ```Matlab -c = a + b; +c = a - b; ``` @@ -62,7 +62,8 @@ $ git status <br> Now, add the file (bring it on stage) ```bash -$ git add firstCommit/addTwoNumbers_myName.m +$ git add addTwoNumbers_myName.m +$ git status # returns the same as before, generally in green (means staged) ``` @@ -78,21 +79,15 @@ exit with `q` ## Add a commit message ```bash -$ git commit -m "Uncommented line for adding 2 numbers" +$ git commit -m "Correcting formula for adding 2 numbers" $ git status ``` -<br> -You can pull, even at this stage, new possible changes -```bash -$ git pull -``` - -## Push your file to the repository +## Push your file to your fork ```bash -$ git push +$ git push origin add-2-numbers ``` <div class="fragment"> @@ -106,19 +101,21 @@ exit by typing `q` ## Do it yourself -* Modify and rename `secondCommit/multiplyTwoNumbers.m` +* Modify and rename `secondCommit/multiplyTwoNumbers_myName.m` * Push the file `secondCommit/multiplyTwoNumbers_myName.m` -* Don't forget to add <font color="red">`_myName`</font> +* Don't forget to edit <font color="red">`_myName`</font> <div class="fragment"> <br> Commands: ```bash -$ git pull -$ git diff # optional +$ git checkout develop +$ git pull origin develop +$ git checkout -b multiply-2-numbers +# make changes to file $ git add secondCommit/multiplyTwoNumbers_myName.m -$ git commit -m "Uncommented line for multiplying 2 numbers" +$ git commit -m "Corrected formula for multiplying 2 numbers" $ git status -$ git push +$ git push origin multiply-2-numbers $ git log # optional ``` diff --git a/slides/forks.md b/slides/forks.md index fd848cf70007e4f47212fdb95a4dcfa4ee94ede1..c5aa8bc801f7df0fcfce2c0a7cb5606b70827774 100644 --- a/slides/forks.md +++ b/slides/forks.md @@ -34,13 +34,12 @@ Browse to the original repository and click on the button `Fork`:  -(Live Demo) +<div class="fragment"> +<img src="img/icon-live-demo.png" height="100px"> ## Time to practice! -(Live Demo) - <br> Fork the practice repository: <br><br> @@ -48,6 +47,10 @@ https://git-r3lab.uni.lu/R3school/git.practice Then, clone your fork to your home directory! +<div class="fragment"> +<br> +<img src="img/icon-live-demo.png" height="100px"> + <div class="fragment"> <br> ```bash diff --git a/slides/github_gitlab.md b/slides/github_gitlab.md index 920ba0e78a611a2495b15bd30d7e2a3f4298be87..46d88f8694fc1dccaaaf7687db9b27790d356bea 100644 --- a/slides/github_gitlab.md +++ b/slides/github_gitlab.md @@ -10,14 +10,19 @@ GitHub is **public**, whereas GitLab is **restricted/private**. Positive point: GitHub and GitLab are (almost) the same. -## GitHub (Live Demo) +## GitHub [www.github.com](www.github.com) <br><img src="https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub" style="width: 200px;"/> +<div class="fragment"> +<img src="img/icon-live-demo.png" height="100px"> -## GitLab (Live Demo) + +## GitLab [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;"/> +<div class="fragment"> +<img src="img/icon-live-demo.png" height="100px"> \ No newline at end of file diff --git a/slides/homework.md b/slides/homework.md index eba158fac1f4adbb4c737ac3b005025083c4f99e..018219262f90d45d3a86f6ad97a3a3d58fe6befb 100644 --- a/slides/homework.md +++ b/slides/homework.md @@ -13,20 +13,20 @@ Don't forget to properly configure `git` with your username and email as explain ## Task - - create a fork of the repository <br>https://git-r3lab.uni.lu/R3/R3.practice + - create a fork of the repository <br>https://git-r3lab.uni.lu/R3school/git.practice - commit some code - create a merge request on `GitLab`. ## Detailed instructions -- First, fork the [https://git-r3lab.uni.lu/R3/R3.practice](https://git-r3lab.uni.lu/R3/R3.practice) repository. +- First, fork the [https://git-r3lab.uni.lu/R3school/git.practice](https://git-r3lab.uni.lu/R3school/git.practice) repository. - Create the new branch `homework_myName`. -- Implement a new function (create a new file `sqrt_myName.m`) called `sqrt_myName(x)` that computes the square root of `x`. +- Implement a new function (create a new file `sqrt_myName.m` in a new folder `src/thirdCommit`) called `sqrt_myName(x)` that computes the square root of `x`. -- Rename the `test.m` file in the `test/` directory to `test_myName.m`. +- Rename the `test.m` file in the `test/suite` directory to `test_myName.m`. - Edit the file `test.m` and change the names of the functions accordingly. diff --git a/slides/img/branch-i-state.graffle b/slides/img/branch-i-state.graffle deleted file mode 100644 index 1963daeff8e3b784c6806fc829b9172f05f9f3e4..0000000000000000000000000000000000000000 Binary files a/slides/img/branch-i-state.graffle and /dev/null differ diff --git a/slides/img/branch-merge.png b/slides/img/branch-merge.png index 8499c5dcf20033c032aed70f7925fc2e6acee6ac..b3f4687642cdf98cf086e7d03c86eccea212ed65 100644 Binary files a/slides/img/branch-merge.png and b/slides/img/branch-merge.png differ diff --git a/slides/img/graffle/branch-i-state.graffle b/slides/img/graffle/branch-i-state.graffle new file mode 100644 index 0000000000000000000000000000000000000000..7f2e3d401791c62cb2c615fec2dce64c4a6fb787 Binary files /dev/null and b/slides/img/graffle/branch-i-state.graffle differ diff --git a/slides/img/fork.graffle/data.plist b/slides/img/graffle/fork.graffle/data.plist similarity index 100% rename from slides/img/fork.graffle/data.plist rename to slides/img/graffle/fork.graffle/data.plist diff --git a/slides/img/fork.graffle/image1.tiff b/slides/img/graffle/fork.graffle/image1.tiff similarity index 100% rename from slides/img/fork.graffle/image1.tiff rename to slides/img/graffle/fork.graffle/image1.tiff diff --git a/slides/img/fork.graffle/image2.tiff b/slides/img/graffle/fork.graffle/image2.tiff similarity index 100% rename from slides/img/fork.graffle/image2.tiff rename to slides/img/graffle/fork.graffle/image2.tiff diff --git a/slides/img/gray-linen-background-texture_58348.jpg b/slides/img/gray-linen-background-texture_58348.jpg deleted file mode 100644 index 42d70c58e51fded30a31380a1d204248c2a6b047..0000000000000000000000000000000000000000 Binary files a/slides/img/gray-linen-background-texture_58348.jpg and /dev/null differ diff --git a/slides/img/icon-live-demo.png b/slides/img/icon-live-demo.png new file mode 100644 index 0000000000000000000000000000000000000000..1511dc7e76a9240d19b7e854fe9b6912d098edd8 Binary files /dev/null and b/slides/img/icon-live-demo.png differ diff --git a/slides/img/r3-training-logo.png b/slides/img/r3-training-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..48a3aeaa54640a2bde1d4534dd9922d2ea90840c Binary files /dev/null and b/slides/img/r3-training-logo.png differ diff --git a/slides/img/remote-0-master.png b/slides/img/remote-0-master.png deleted file mode 100644 index 41bd35a24b71d7bed56771492e0581bd3ed0e410..0000000000000000000000000000000000000000 Binary files a/slides/img/remote-0-master.png and /dev/null differ diff --git a/slides/img/remote-1-remote.png b/slides/img/remote-1-remote.png deleted file mode 100644 index 9b6643a0c531e8ca55297c02bfceeffafa75726e..0000000000000000000000000000000000000000 Binary files a/slides/img/remote-1-remote.png and /dev/null differ diff --git a/slides/img/remote-2-push.png b/slides/img/remote-2-push.png deleted file mode 100644 index c869f1ca3a8200475e0407c8167acfc14db94253..0000000000000000000000000000000000000000 Binary files a/slides/img/remote-2-push.png and /dev/null differ diff --git a/slides/img/remote-i-state.graffle b/slides/img/remote-i-state.graffle deleted file mode 100644 index 7e60eadf4998b1682571e0ad660d70eaf9aac7be..0000000000000000000000000000000000000000 Binary files a/slides/img/remote-i-state.graffle and /dev/null differ diff --git a/slides/index.md b/slides/index.md index 539414da24261f4211cfc315ec1db4b5100e500a..ff85ce364e931d5fb9b6d5312d7c5450e1f8ebdf 100644 --- a/slides/index.md +++ b/slides/index.md @@ -1,15 +1,11 @@ -Absolute Beginners<br> -<img src="img/Git-Logo-Black.png" class="as-is" height="100px"><br>Workshop -<br> +<img src="img/Git-Logo-Black.png" class="as-is" height="100px"><br>Training for absolute beginners -<img src="img/logoLCSB.png" class="as-is" height="100px"> +<img src="img/r3-training-logo.png" class="as-is" height="200px"> <br><br><br><br> -<br><br> +<br> January 24th, 2019 **Laurent Heirendt, Ph.D.**<br> -laurent.heirendt@uni.lu - -<br><br><br><br> +laurent.heirendt@uni.lu \ No newline at end of file diff --git a/slides/installation.md b/slides/installation.md index 8c9cc67aecc707aef39c9dc4bf662584c512f12a..deec7d09a434edccdd7916dd65b4cb66daa93c2e 100644 --- a/slides/installation.md +++ b/slides/installation.md @@ -21,7 +21,7 @@ $ sudo apt-get install git-all ## How to get started? -**Linux (Ubuntu)** and **macOS** +**macOS** Start the `Terminal` or `iTerm`. @@ -30,6 +30,11 @@ Start the `Terminal` or `iTerm`. Start `GUI Bash`. +<br> +**Linux (Ubuntu)** + +Start the `Terminal` or `Terminator`. + ## Is `git` properly installed? diff --git a/slides/merge.md b/slides/merge.md index 02b0e99f68b2eb72df14f07829ec2b2106571963..e7b39dd1ec103b520eeecc35f2e853258f29e707 100644 --- a/slides/merge.md +++ b/slides/merge.md @@ -1,7 +1,6 @@ +## Pull and merge requests -## Merge a branch - -If you want your feature on the `develop` or `master` branches, +If you want your changes to be reflected on the `develop` or `master` branches, **submit a MR or a PR** via the Github/Gitlab interface. <br> @@ -9,35 +8,10 @@ Use the **interface** to make use of your peers to review your code! <img src="img/branch-merge.png" class="branch-merge" /> + <br> Once merged, you can delete the branch via the interface. - -## Github interface -<img src="https://assets-cdn.github.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub" style="width: 100px;"/> - -Detailed information is on [help.github.com/articles/creating-a-pull-request/](https://help.github.com/articles/creating-a-pull-request/). - -1. Click on **New pull request** - - -<br><br> -2. Compare the branches - - - - -<ol start="3"> - <li>Assign your peer - <br> - -  - </li> -</ol> - - -<ol start="4"> - <li>Submit the PR - - </li> -</ol> +<div class="fragment"> +<br> +<img src="img/icon-live-demo.png" height="100px"> \ No newline at end of file diff --git a/slides/overview.md b/slides/overview.md index 6d8a0f18ae637834b8c101f5366e387c5983dbc0..b6fdb1f93f877caa319acb75f2890ed3283c9c39 100644 --- a/slides/overview.md +++ b/slides/overview.md @@ -2,10 +2,15 @@ 0. The terminal 1. The editor -1. What is `git`? What is the use of `git`? <!--(5 min)//--> -2. GitHub and GitLab <!--(5min)//--> +2. What is `git`? What is the use of `git`? <!--(5 min)//--> 3. Installation of `git` -4. The 5 essential commands <!--(10 min)//--> +4. GitHub and GitLab <!--(5min)//--> +5. How do I configure `git`? <!--(5min)//--> +6. Where and how to start <!--(5min)//--> +7. What is a fork? <!--(5min)//--> +8. What are branches? +9. The 5 essential commands <!--(10 min)//--> * `pull` / `status` / `add` / `commit` / `push` -5. Branches <!--(10 min)//--> -7. Best practices +10. What are merge/pull requests? <!--(10 min)//--> +11. How do I synchronize my fork? +12. Best practices \ No newline at end of file diff --git a/slides/syncFork.md b/slides/syncFork.md index 75066c06c689d9616d7c73ec668b013c6744d8ad..aacd622ff512e679e3d9d1466bd58e64ef87c142 100644 --- a/slides/syncFork.md +++ b/slides/syncFork.md @@ -44,4 +44,4 @@ Do the same for the `develop` branch<br> ## Time to practice! -(Live Demo) \ No newline at end of file +<img src="img/icon-live-demo.png" height="100px"> \ No newline at end of file diff --git a/slides/thanks.md b/slides/thanks.md index c88cfb83f47ad22d3d1351b12b82914253da7f92..7337d53f0c95ed0f7d3bca99e1b6afa1cb59552b 100644 --- a/slides/thanks.md +++ b/slides/thanks.md @@ -30,3 +30,12 @@ https://git-scm.com/book/en/v2 <br>[3]: Cheat sheet: http://rogerdudler.github.io/git-guide + +## Thank you. + +<img src="img/r3-training-logo.png" height="200px"> + +Contact us if you need help: + +r3lab.core@uni.lu + diff --git a/slides/the_editor.md b/slides/the_editor.md index 6de4cfcda120fd441a8bc70b9f57af7eac776d0d..6a9ad3b5974c7640cbfd252eb1fded5854105f6b 100644 --- a/slides/the_editor.md +++ b/slides/the_editor.md @@ -8,4 +8,4 @@ Recommended editors: ## Visual Studio Code -<br>(Live Demo) \ No newline at end of file +<br><img src="img/icon-live-demo.png" height="100px"> \ No newline at end of file diff --git a/slides/the_terminal.md b/slides/the_terminal.md index 1c6c663fc330437ffaf76a165775a1b6849d7da4..61f9a9cc51ecccb12433f73a6de534f21c1d70b7 100644 --- a/slides/the_terminal.md +++ b/slides/the_terminal.md @@ -43,7 +43,7 @@ in your home directory (unless otherwise configured), denoted as `~/`. List the contents of a directory ```bash -$ ls +$ ls #-lash ``` <div class="fragment"> diff --git a/slides/what_is_git.md b/slides/what_is_git.md index a0489ee7238b4a301b3f66e52b8b8b153056509c..f33694ff2c6f3177273d3f6bb519432cca1ec810 100644 --- a/slides/what_is_git.md +++ b/slides/what_is_git.md @@ -11,7 +11,7 @@ <div align="left"><small>[1] *https://en.wikipedia.org/wiki/Git*</small></div> -## Funny story +## The inventor of `git`  <br><br>