diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/best_practices.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/best_practices.md new file mode 100644 index 0000000000000000000000000000000000000000..dea55feec7e3ad5a6717044baf28d41001ce6d4d --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/best_practices.md @@ -0,0 +1,20 @@ +# Best practices + +* `pull` before `push` +* Work on your <font color="red">own</font> branch (in your own fork), and **not** on `master` and **not** on `develop` +* Do **not push** to `master`, but **submit a PR** +* Get your code **reviewed** by your peers (submit a PR!) +* Submit a PR **often**! +* `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.md + ``` +* Commit **only a few files** at once (after multiple separate `git add` commands) +* `Push` often - avoid conflicts + +Remember: **A `push` a day keeps conflicts away!** diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/branches.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/branches.md new file mode 100644 index 0000000000000000000000000000000000000000..0c91358cb047d118836dd31d9e93cf8655f06601 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/branches.md @@ -0,0 +1,98 @@ +# Development scheme + + +Generally, in a repository, there are guidelines for contributing. + +<div class="fragment"> + +A common development scheme is dual with a: + +- **development** version of the code on `develop` +- **stable** version of the code on `master` + + +A **version** of the code is referred to as a **branch**. + +<div class="fragment"> + +<img src="slides/img/icon-live-demo.png" height="100px"> + + +<font color="red">In the practice repository, the development branch is called `develop`!</font> + +<div class="fragment"> + + Use this dual development scheme for your own repositories! + + + +# Branches + +A **version** of the code (i.e., a **branch**) is made up of a sequence of code changes. + +<div class="fragment"> + +These individual code changes are called **commits**. + + +For instance, the `master` and `develop` branches can be represented as a timeline: +<img src="slides/img/branch-master.png" class="branch-master" height="500em"/> + + + +# Switch between branches + +List all branches of the repository with +```bash +$ git branch -a +``` + +Exit by typing `q`. The branch with the * is the current branch. + +<div class="fragment"> + +Checkout another branch +```bash +$ git checkout <branchName> +``` + +<div class="fragment"> + +You can switch to the `develop` branch with +```bash +$ git checkout develop +``` +If the local branch does not exist but the remote does, it is created automatically. + +<div class="fragment"> + +<img src="slides/img/icon-live-demo.png" height="100px"> + + + +# Create your own version + +Assume that you want to work on a file: + +<div class="fragment"> + +<font color="red">Create a new **branch**!</font> + +```bash +$ git checkout -b myBranch +``` +The `-b` flag creates the branch. Locally, you have your own version now: +<img src="slides/img/branch-create.png" class="branch-create" height="500em"/> + + + + +Push your version to your fork: +```bash +$ git push origin myBranch +``` + + +<div class="fragment"> + +<img src="slides/img/icon-live-demo.png" height="100px"> diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/cloneRepo.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/cloneRepo.md new file mode 100644 index 0000000000000000000000000000000000000000..887a6e087e73a14ef7ad3790f9e7d0d67ce04b14 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/cloneRepo.md @@ -0,0 +1,14 @@ +# How do I start working on a repository? + +You have to `clone` it first: + +```bash +$ git clone git@github.com:userName/myRepo.git myRepo +``` + +If you did not configure your SSH key, clone using HTTPS: +```bash +$ git clone https://github.com/userName/myRepo.git myRepo +``` + +You will be prompted to enter your credentials. diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/configuration.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/configuration.md new file mode 100644 index 0000000000000000000000000000000000000000..0b07cc4185a35481545f81af5e0f4d8fbc3de063 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/configuration.md @@ -0,0 +1,46 @@ +# How to configure `git`? + +```bash +$ git config --global user.name "Firstname Lastname" +$ git config --global user.email "first.last@uni.lu" +``` + +Test whether your username and email have been registered + +```bash +$ git config --list +``` + +This should list the configuration with `user.name` and `user.email`. + +Exit by typing `q`. + + + +# What is an SSH key? + +An SSH key is a secure access credential. + +**Principle**: <br><br> +Communicate **securely** with Github/Gitlab **without** entering the username/password. + + + +# How do I get and set my SSH key? + +Check if you already have an SSH key: + +```bash +$ ls -al ~/.ssh +``` + +If there are 2 files named `id_rsa`, you have an SSH key. + +If you don’t have yet an SSH key, you have to generate one: +```bash +$ ssh-keygen -t rsa # -b 4096 +``` + +Then, add the SSH key to Github/Gitlab. + +<img src="slides/img/icon-live-demo.png" height="100px"> \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/essential_commands.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/essential_commands.md new file mode 100644 index 0000000000000000000000000000000000000000..0fa56f47884b92c3b64762cf696fed6f7a014b7b --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/essential_commands.md @@ -0,0 +1,98 @@ +# The 5 essential commands + + +**Yes**, you only need 5 commands! + +`pull, status, add, commit, push` + +or in other words (remember these!): +```bash +$ git pull <remote> <branch> +$ git status +$ git add myFile.md # example +$ git commit -m "myMessage" # example +$ git push <remote> <branch> +``` + + + +# Pull the latest version of an existing branch + +Pull the latest revision on branch `myBranch`: +```bash +$ git pull origin myBranch +# Already up to date +``` + +<div class="fragment"> + +Verify its `status` with: +```bash +$ git status +``` + + + +# Modify a file + +Copy the file `template.md` in the folder `_attendees` and rename it with your firstname: + +```bash +$ cd _attendees +$ cp template.md myName.md +``` + +Then, make your changes with your favorite editor! + + + +# Add your file to the stage + +First, check the repository status +```bash +$ git status +# uncommitted changes (displayed in red) +``` + + +<div class="fragment"> + +Now, add the file (bring it on stage) +```bash +$ git add myName.md # replace myName +$ git status +# returns the same as before, generally in green (means staged) +``` + +<div class="fragment"> + +**ADVANCED**: If there have been more changes after the file has been added, you can see your changes in the terminal +```bash +$ git diff +``` +exit with `q` + + + +# Add a commit message + +```bash +$ git commit -m "Add the profile of <myName>" +$ git status +``` + + + +# Push your file to your fork + +```bash +$ git push origin myBranch +``` + +<div class="fragment"> + +**ADVANCED**: see the log of all the commits (and your last one) in the terminal +```bash +$ git log +``` +exit by typing `q`. \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/forks.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/forks.md new file mode 100644 index 0000000000000000000000000000000000000000..46abc880bae9f185d52f44d43e6a547ba5a09b27 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/forks.md @@ -0,0 +1,79 @@ +# What is a `fork`? + +<img src="slides/img/fork.jpg" class="as-is" height="500em"/> +<!--http://www.cndajin.com/data/wls/246/22302193.jpg--> + + + +# Not really ... + +<img src="slides/img/fork-crossed.png" class="as-is" height="500em"/> + + + +# What is a `fork`? + +In general, when contributing to a repository, you only have **read** access. + +In other words, you can only **pull** (unless it is your own repository or access has been granted). + +In general, you **cannot write** changes. In other words, you do not have **push** access. + +You have to work on your **own copy**. + +In other words, you have to work on your own <font color="red">**fork**</font>. + + + +# How to get a fork? + +Browse to the original repository and click on the button `Fork`: + + + +<img src="slides/img/icon-live-demo.png" height="100px"> + + + +# Time to practice! + +Fork the practice repository: <br><br> +https://github.com/LCSB-BioCore/basic-git-practice + +Then, clone your fork to your home directory! + +<img src="slides/img/icon-live-demo.png" height="100px"> + +```bash +$ git clone git@github.com:<yourName>/basic-git-practice.git +``` + +Change to the practice directory with: +```bash +$ cd basic-git-practice +``` + + + +# A note on shortcuts ... + +<font color="red"> +Any other rudimentary method such as + +*'I simply download the `.zip` and unzip it - works like a charm!'* + +shall **be avoided**! +</font> + +**Why?** + + + +# How to update my fork? + +As you have your own fork, it will not automatically be updated once the original repository is updated. + + You have to update it yourself! + +**More on that later!** + diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/github_gitlab.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/github_gitlab.md new file mode 100644 index 0000000000000000000000000000000000000000..84930c3922e96a6f2bb75d3ed85881aa19c2e2de --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/github_gitlab.md @@ -0,0 +1,18 @@ +# GitHub and GitLab + +<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub" style="width: 200px;"/> +<img src="https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-extra-whitespace.png" alt="GitLab" style="width: 200px;"/> + +GitHub and GitLab are VCS systems. + +GitHub/Gitlab are both **publicly available**, but GitLab can be **on-premise**. + +Positive point: GitHub and GitLab are (almost) the same. + + +<img src="slides/img/icon-live-demo.png" height="100px"> + + +- **GitHub**: [https://github.com](https://github.com) +- Public GitLab: [https://gitlab.com](https://gitlab.com) +- LCSB specific: [https://git-r3lab.uni.lu](https://git-r3lab.uni.lu) \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/Git-Logo-Black.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/Git-Logo-Black.png new file mode 100644 index 0000000000000000000000000000000000000000..b7ed63f2d105656638665907bab77c5e4e375b3d Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/Git-Logo-Black.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/arianeLaunch.mov b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/arianeLaunch.mov new file mode 100644 index 0000000000000000000000000000000000000000..8b516a6c16ed1eb0cc1093dc8276fec214cb520e --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/arianeLaunch.mov @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff78e3c12e93a7548177269db5d4d1e6c0b36cee0802d6a0e02152623287390f +size 11346236 diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/branch-create.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/branch-create.png new file mode 100644 index 0000000000000000000000000000000000000000..bfea05c8f214876c9f53ef6a50aa5220b0eef976 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/branch-create.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/branch-master.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/branch-master.png new file mode 100644 index 0000000000000000000000000000000000000000..04ccddf15f4a487c8432bf111be3766b2424f53e Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/branch-master.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/branch-merge.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/branch-merge.png new file mode 100644 index 0000000000000000000000000000000000000000..92f31b5e457f0474e11c9b9d5415f2ad0f3efc85 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/branch-merge.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/bulb.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/bulb.png new file mode 100644 index 0000000000000000000000000000000000000000..590f8d9270fea6be86b5e356cb07cd9232ef7056 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/bulb.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/computerCode.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/computerCode.png new file mode 100644 index 0000000000000000000000000000000000000000..d7c9e74d328fc7742d4a416a62d0c72213dc9294 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/computerCode.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/favicon.ico b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..9b935c03f6f841601835db006ed02b582166cdc8 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/favicon.ico differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/fork-crossed.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/fork-crossed.png new file mode 100644 index 0000000000000000000000000000000000000000..cd93216af30439024a36d2d6355d0eae28324511 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/fork-crossed.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/fork.jpg b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/fork.jpg new file mode 100644 index 0000000000000000000000000000000000000000..35ef53f4225b9286280c99d2c23f1594d380d6c5 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/fork.jpg differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/git_definition.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/git_definition.png new file mode 100644 index 0000000000000000000000000000000000000000..0676fc7a299fae5c7c3389eed91e21fcb050c629 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/git_definition.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/github_app.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/github_app.png new file mode 100644 index 0000000000000000000000000000000000000000..3cc77f55371f4fdd960e778e4dfcfa5eee1adca4 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/github_app.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/icon-live-demo.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/icon-live-demo.png new file mode 100644 index 0000000000000000000000000000000000000000..4b9e6f031078329479b4cc8ea875b9657fda224a Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/icon-live-demo.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/installation.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/installation.png new file mode 100644 index 0000000000000000000000000000000000000000..dd278a70c5e8237d32c047759e47fb0812db9db0 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/installation.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/linus.jpg b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/linus.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5b1cb08a41ecbd2962e253e56ee61f336f1a523b Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/linus.jpg differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/logoLCSB.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/logoLCSB.png new file mode 100644 index 0000000000000000000000000000000000000000..9ca3f0adea7781ff00043b3f5465b28a89026287 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/logoLCSB.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/qualitybadge.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/qualitybadge.png new file mode 100644 index 0000000000000000000000000000000000000000..4c2aea855d8168733099d04286c9497338a8bf63 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/qualitybadge.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/r3-training-logo.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/r3-training-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..48a3aeaa54640a2bde1d4534dd9922d2ea90840c Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/r3-training-logo.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/redcross.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/redcross.png new file mode 100644 index 0000000000000000000000000000000000000000..9c4abc89436ea8c528992dbd7be484a1e2fe2c6b Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/redcross.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/reproCrisis.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/reproCrisis.png new file mode 100644 index 0000000000000000000000000000000000000000..d62dc06f732837b9380b15f8e21575db19710bd2 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/reproCrisis.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/snoopy.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/snoopy.png new file mode 100644 index 0000000000000000000000000000000000000000..af89c0b75a83f3339190f67987c306e1bd171c07 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/snoopy.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/therac.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/therac.png new file mode 100644 index 0000000000000000000000000000000000000000..cc9624e5907199ff4bae43ccc03d8ea80b45026b Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/therac.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/wheel.png b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/wheel.png new file mode 100644 index 0000000000000000000000000000000000000000..9c40a2d45e8b881ee055a58b376522ae0a69ef73 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/img/wheel.png differ diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/index.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/index.md new file mode 100644 index 0000000000000000000000000000000000000000..a2726fc450ceafef47b4ad4f7b56bdc0319902d3 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/index.md @@ -0,0 +1,19 @@ +# R3.school + +## June 11th, 2019 + +<div style="top: 6em; left: 0%; position: absolute;"> + <img src="theme/img/lcsb_bg.png"> +</div> + +<div style="top: 5em; left: 60%; position: absolute;"> + <img src="slides/img/r3-training-logo.png" height="200px"> + <br><br><br> + <h1>git training for absolute beginners</h1> + <br><br><br><br> + <h4> + Laurent Heirendt, Ph.D.<br><br> + laurent.heirendt@uni.lu<br><br> + <i>Luxembourg Centre for Systems Biomedicine</i> + </h4> +</div> diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/installation.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/installation.md new file mode 100644 index 0000000000000000000000000000000000000000..506be614073e67dd22fc042230ccb1eb236a9792 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/installation.md @@ -0,0 +1,45 @@ +# Installation of `git` + +<img src="slides/img/github_app.png" class="as-is" height="200" /> + +**macOS** + +Install *Xcode Command Line Tools* + + +**Windows** + +Install Git Bash: <br>`https://git-scm.com/download/win` + + +**Linux (Ubuntu)** + +```bash +$ sudo apt-get install git-all +``` + + + +# How to get started? + +**macOS** + +Start the `Terminal` or `iTerm`. + + +**Windows** + +Start `GUI Bash`. + + +**Linux (Ubuntu)** + +Start the `Terminal` or `Terminator`. + + +**Is `git` properly installed?** + +```bash +$ git --version +# git version 2.10.0 +``` \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/list.json b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/list.json new file mode 100644 index 0000000000000000000000000000000000000000..e06ee227643e58157bcacd9221c2d00ceff5d03a --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/list.json @@ -0,0 +1,65 @@ +[ + { + "filename": "index.md" + }, + { + "filename": "overview.md" + }, + { + "filename": "wheel.md" + }, + { + "filename": "repro_crisis.md" + }, + { + "filename": "whatiscode.md" + }, + { + "filename": "whyCare.md" + }, + { + "filename": "qualityCode.md" + }, + { + "filename": "what_is_git.md" + }, + { + "filename": "the_terminal.md" + }, + { + "filename": "the_editor.md" + }, + { + "filename": "installation.md" + }, + { + "filename": "github_gitlab.md" + }, + { + "filename": "configuration.md" + }, + { + "filename": "cloneRepo.md" + }, + { + "filename": "forks.md" + }, + { + "filename": "branches.md" + }, + { + "filename": "essential_commands.md" + }, + { + "filename": "merge.md" + }, + { + "filename": "syncFork.md" + }, + { + "filename": "best_practices.md" + }, + { + "filename": "thanks.md" + } +] diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/merge.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/merge.md new file mode 100644 index 0000000000000000000000000000000000000000..5b59e684ec66bb668ce48a929608f4de6f238807 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/merge.md @@ -0,0 +1,13 @@ +# Pull and merge requests + +If you want your changes to be reflected on the `develop` or `master` branches, +**submit a PR** via the Github interface. + +Use the **interface** to make use of your peers to review your code! +<img src="slides/img/branch-merge.png" class="branch-merge" height="500em"/> + +Once merged, you can delete the branch via the interface. + +<div class="fragment"> + +<img src="slides/img/icon-live-demo.png" height="100px" > \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/overview.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/overview.md new file mode 100644 index 0000000000000000000000000000000000000000..569ee3789fd8f0a16e39ac938b9f7c5764adce04 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/overview.md @@ -0,0 +1,17 @@ +# Overview + +1. **PART I**: Quality of computer code. +2. **PART II**: Basic git course + 1. The terminal + 2. The editor + 3. What is `git`? What is the use of `git`? <!--(5 min)//--> + 4. Installation of `git` + 5. GitHub and GitLab <!--(5min)//--> + 6. How do I configure `git`? <!--(5min)//--> + 7. Where and how to start? <!--(5min)//--> + 8. What is a fork? <!--(5min)//--> + 9. What are branches? + 10. The 5 essential commands (`pull` / `status` / `add` / `commit` / `push`) + 11. What are merge/pull requests? <!--(10 min)//--> + 12. How do I synchronize my fork? + 13. Best practices \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/qualityCode.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/qualityCode.md new file mode 100644 index 0000000000000000000000000000000000000000..24abf2c8bba903e0f4e213e3fc049ad7f253636b --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/qualityCode.md @@ -0,0 +1,34 @@ +# Quality of computer code is relevant for everyone. + +`This does not concern me – I am only writing documentation or a script for generating a figure that I want to publish!` +[Anonymous researcher] + +<div class="fragment"> + +**Great**, but ... + +- Figure may not be reproducible +- Figure looks different when the input data changes +- Documentation will become outdated + +… actually, **EVERYONE** writing documentation, a script, or code is concerned! + +<div align="center"> +<img src="slides/img/snoopy.png" height="400px"> +</div> + + + +# Attributes of high-quality computer code + +**Quality** of computer code can be seen as a **group of various attributes**. + +High-quality computer code should be: + +1. <font color="#A52A2A">**Versioned**</font>: incremental code +2. <font color="#FFA500">**Well-written**</font> (formatted, documented, commented): easy to read by a human +3. <font color="#008931">**Tested**</font>: extensively tested code + +<div align="center"> +<img src="slides/img/qualitybadge.png"> +</div> \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/repro_crisis.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/repro_crisis.md new file mode 100644 index 0000000000000000000000000000000000000000..8e411c3b8a50de544cdc79ab423a97f97d0407af --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/repro_crisis.md @@ -0,0 +1,7 @@ +# Reproducibility crisis + +<div align="center"> +<img src="slides/img/reproCrisis.png"> +</div> + +*Baker, M., <a href="https://www.nature.com/news/1-500-scientists-lift-the-lid-on-reproducibility-1.19970">1,500 scientists lift the lid on reproducibility</a>, Nature 533, 452–454, 2016. doi:10.1038/533452a* \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/syncFork.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/syncFork.md new file mode 100644 index 0000000000000000000000000000000000000000..a908869569972adac700f623ec73566b8af5d90c --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/syncFork.md @@ -0,0 +1,40 @@ +# Synchronize your fork + + Remember, we have to regularly update our own copy of the code. + + +Add the `upstream` address (original/protected repository) +```bash +$ git remote add upstream git@github.com:LCSB-BioCore/basic-git-practice.git +``` + + Note the change in the URL. + + +You can then check whether the remote address is set correctly +```bash +$ git remote -v +``` + +<div class="fragment"> + +Fetch the changes from upstream (similar to pull) +```bash +$ git fetch upstream +``` + + + + +Merge the retrieved changes on the `master` branch: +```bash +$ git checkout master +$ git merge upstream/master +$ git push origin master +``` + +<div class="fragment"> + +Do the same for the `develop` branch. + +<img src="slides/img/icon-live-demo.png" height="100px"> \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/thanks.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/thanks.md new file mode 100644 index 0000000000000000000000000000000000000000..9f1d826bb46c503b32d1f228512970e726c00618 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/thanks.md @@ -0,0 +1,42 @@ +# Let's refresh our memories + +<div class="fragment"> + +- What is a **fork**? + +<div class="fragment"> + +- What are **branches**? + +<div class="fragment"> + +- Can I have **multiple branches** in my fork? + +<div class="fragment"> + +- What is a good **development scheme**? + +<div class="fragment"> + +- What are the **5 essential commands**? + + + +# References & Cheat sheet + +[1]: Git Book: https://git-scm.com/book/en/v2 + +[2]: GitHub training services: https://services.github.com/training/ + +[3]: Cheat sheet: http://rogerdudler.github.io/git-guide + + + +# Thank you. + +<img src="slides/img/r3-training-logo.png" height="200px"> + +Contact us if you need help: + +r3lab.core@uni.lu + diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/the_editor.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/the_editor.md new file mode 100644 index 0000000000000000000000000000000000000000..bca1b494ce0faed1f5806db841240fd513467d0d --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/the_editor.md @@ -0,0 +1,10 @@ +# The editor(s) + +Recommended editors: + +- **Visual Studio Code** (https://code.visualstudio.com) +- **Atom** (https://atom.io) + +*Note*: Other editors such as IntelliJ IDEA (https://www.jetbrains.com/idea) or Sublime Text (https://www.sublimetext.com) can, of course, also be used. + +<img src="slides/img/icon-live-demo.png" height="100px"> \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/the_terminal.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/the_terminal.md new file mode 100644 index 0000000000000000000000000000000000000000..32e9979c1fc4d3eeb5286280c4b132bcb4fba8d5 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/the_terminal.md @@ -0,0 +1,81 @@ +# PART II + +<br><br><h1>Basic git course</h1> + + + +# The terminal (shell) + +**macOS users:** + +Start the Terminal from your `/Applications` directoy. + + Install iTerm2: `https://www.iterm2.com` + +**Windows users:** + +Install Git Bash: <br>`https://git-scm.com/download/win` + +**Linux users:** + +Launch default terminal.<br> + Install Terminator: `https://launchpad.net/terminator` + + + +# First steps in the terminal + +Starting the terminal presents itself with a line where you can enter a command +```bash +cesar@myComputer> +``` + +Often written, for covenience, as +```bash +$ +``` + +When you open your terminal (shell), you are located +in your home directory (unless otherwise configured), denoted as `~/`. + + + +# Essential Linux commands + +List the contents of a directory +```bash +$ ls #-lash +``` + +Create a directory +```bash +$ mkdir myNewDirectory +``` + +Change the directory to a specific folder +```bash +$ cd myNewDirectory +``` + +Change the directory 1 level and 2 levels up +```bash +$ cd .. +# 1 level up + +$ cd ../.. +# 2 levels up +``` + + + +Move a file or a directory +```bash +$ mv myFile.m myNewDirectory/. +``` + + +Rename a file or a directory +```bash +$ mv myFile.m myNewFile.m +$ mv myNewDirectory myDirectory +``` \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/what_is_git.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/what_is_git.md new file mode 100644 index 0000000000000000000000000000000000000000..973cc0593ed0b3b993e870f74c9e0794301e278e --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/what_is_git.md @@ -0,0 +1,40 @@ +# What is `git`? + +<!--  --> + +`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** + +<div align="center"> +<img src="slides/img/linus.jpg"> +</div> + +[1] *https://en.wikipedia.org/wiki/Git* + + + +# The inventor of `git` + +<div align="center"> +<img src="slides/img/git_definition.png"> +</div> + +`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** +* Keep the changes you made over time (**history**) +* Allows you to **backtrack** (if necessary) and undo unwanted changes +* Easily **add contributions** of your collaborators to the main code base + +note: + +Other points to mention: +* git shall not be considered as a nuisance, but as a tool that should help to track and trace the code. +* git is not to track performance. Not using it shows exactly the opposite. diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/whatiscode.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/whatiscode.md new file mode 100644 index 0000000000000000000000000000000000000000..8a7ec810845093821daaaba558c5c1fe777500c1 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/whatiscode.md @@ -0,0 +1,15 @@ +# What is computer code? + +**Computer code**: Set of instructions executed by a computer + +**Programming language:**: Style of writing the set of instructions (e.g., C, C++, Fortran, Python, R, Matlab, Julia, …) + +**Example:** + +<div align="center"> +<img src="slides/img/computerCode.png"> +</div> + +<div class="fragment"> + +<div align="center"><font color="#A52A2A"><span class="fas fa-arrow-right"></span> Maybe this is not so relevant … or even, why should I care?</font></div> diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/wheel.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/wheel.md new file mode 100644 index 0000000000000000000000000000000000000000..789873bca8091e220bf2f81085af88a9ccd66953 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/wheel.md @@ -0,0 +1,20 @@ +# PART I + +<br><br><h1>Quality of computer code.</h1><br> +<h1>Should you care? What if you didn't?</h1> + + + +# A true story ... + +<div align="center"> +<img src="slides/img/wheel.png"> +</div> + +<table style="width:100%"> + <tr> + <th width="33%" align="center">Researcher who cares about<br>quality of his code</th> + <th width="33%" align="center">Fellow researcher</th> + <th width="33%" align="center">Pi or Manager</th> + </tr> +</table> \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/whyCare.md b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/whyCare.md new file mode 100644 index 0000000000000000000000000000000000000000..75d3c6b492993927a4d793c470fe5a2996a2f721 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/2019-06-11_basicGitTraining/slides/whyCare.md @@ -0,0 +1,33 @@ +# Why you should care (1) + +<div align="center"> +<video width="40%" controls> + <source src="slides/img/arianeLaunch.mov" type="video/mp4"> +Your browser does not support the video tag. +</video> +</div> + +**Aerospace Application**: First launch of Ariane 5, 1996 + +<font color="#A52A2A"><span class="fas fa-times-circle"></span></font> **Problem**: Rocket exploded shortly after liftoff. + +<font color="#FFA500"><span class="fas fa-exclamation-triangle"></span></font> **Root cause of disaster - Software error:** + +Horizontal velocity of the rocket exceeded the limits of the 16-bit signed integer value and led to overflow +Ariane 5 launched with the same software as Ariane 4 - **the code had not been tested** + + + +# Why you should care (2) + +<div align="center"> +<img src="slides/img/therac.png"> +</div> + +**Biotechnology Application**: Therac-25 – computer controlled radiation therapy machine + +<font color="#A52A2A"><span class="fas fa-times-circle"></span></font> **Problem**: Device malfunctions and delivers a lethal dose of radiation - several patients died. + +<font color="#FFA500"><span class="fas fa-exclamation-triangle"></span></font> **Root cause of disaster - Software error:** + +**No testing** of software before release, **lack of documentation** diff --git a/2020/2020-03-30_basicGitTraining/slides/best_practices.md b/2020/2020-03-30_basicGitTraining/slides/best_practices.md new file mode 100644 index 0000000000000000000000000000000000000000..dea55feec7e3ad5a6717044baf28d41001ce6d4d --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/best_practices.md @@ -0,0 +1,20 @@ +# Best practices + +* `pull` before `push` +* Work on your <font color="red">own</font> branch (in your own fork), and **not** on `master` and **not** on `develop` +* Do **not push** to `master`, but **submit a PR** +* Get your code **reviewed** by your peers (submit a PR!) +* Submit a PR **often**! +* `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.md + ``` +* Commit **only a few files** at once (after multiple separate `git add` commands) +* `Push` often - avoid conflicts + +Remember: **A `push` a day keeps conflicts away!** diff --git a/2020/2020-03-30_basicGitTraining/slides/branches.md b/2020/2020-03-30_basicGitTraining/slides/branches.md new file mode 100644 index 0000000000000000000000000000000000000000..0c91358cb047d118836dd31d9e93cf8655f06601 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/branches.md @@ -0,0 +1,98 @@ +# Development scheme + + +Generally, in a repository, there are guidelines for contributing. + +<div class="fragment"> + +A common development scheme is dual with a: + +- **development** version of the code on `develop` +- **stable** version of the code on `master` + + +A **version** of the code is referred to as a **branch**. + +<div class="fragment"> + +<img src="slides/img/icon-live-demo.png" height="100px"> + + +<font color="red">In the practice repository, the development branch is called `develop`!</font> + +<div class="fragment"> + + Use this dual development scheme for your own repositories! + + + +# Branches + +A **version** of the code (i.e., a **branch**) is made up of a sequence of code changes. + +<div class="fragment"> + +These individual code changes are called **commits**. + + +For instance, the `master` and `develop` branches can be represented as a timeline: +<img src="slides/img/branch-master.png" class="branch-master" height="500em"/> + + + +# Switch between branches + +List all branches of the repository with +```bash +$ git branch -a +``` + +Exit by typing `q`. The branch with the * is the current branch. + +<div class="fragment"> + +Checkout another branch +```bash +$ git checkout <branchName> +``` + +<div class="fragment"> + +You can switch to the `develop` branch with +```bash +$ git checkout develop +``` +If the local branch does not exist but the remote does, it is created automatically. + +<div class="fragment"> + +<img src="slides/img/icon-live-demo.png" height="100px"> + + + +# Create your own version + +Assume that you want to work on a file: + +<div class="fragment"> + +<font color="red">Create a new **branch**!</font> + +```bash +$ git checkout -b myBranch +``` +The `-b` flag creates the branch. Locally, you have your own version now: +<img src="slides/img/branch-create.png" class="branch-create" height="500em"/> + + + + +Push your version to your fork: +```bash +$ git push origin myBranch +``` + + +<div class="fragment"> + +<img src="slides/img/icon-live-demo.png" height="100px"> diff --git a/2020/2020-03-30_basicGitTraining/slides/cloneRepo.md b/2020/2020-03-30_basicGitTraining/slides/cloneRepo.md new file mode 100644 index 0000000000000000000000000000000000000000..887a6e087e73a14ef7ad3790f9e7d0d67ce04b14 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/cloneRepo.md @@ -0,0 +1,14 @@ +# How do I start working on a repository? + +You have to `clone` it first: + +```bash +$ git clone git@github.com:userName/myRepo.git myRepo +``` + +If you did not configure your SSH key, clone using HTTPS: +```bash +$ git clone https://github.com/userName/myRepo.git myRepo +``` + +You will be prompted to enter your credentials. diff --git a/2020/2020-03-30_basicGitTraining/slides/configuration.md b/2020/2020-03-30_basicGitTraining/slides/configuration.md new file mode 100644 index 0000000000000000000000000000000000000000..0b07cc4185a35481545f81af5e0f4d8fbc3de063 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/configuration.md @@ -0,0 +1,46 @@ +# How to configure `git`? + +```bash +$ git config --global user.name "Firstname Lastname" +$ git config --global user.email "first.last@uni.lu" +``` + +Test whether your username and email have been registered + +```bash +$ git config --list +``` + +This should list the configuration with `user.name` and `user.email`. + +Exit by typing `q`. + + + +# What is an SSH key? + +An SSH key is a secure access credential. + +**Principle**: <br><br> +Communicate **securely** with Github/Gitlab **without** entering the username/password. + + + +# How do I get and set my SSH key? + +Check if you already have an SSH key: + +```bash +$ ls -al ~/.ssh +``` + +If there are 2 files named `id_rsa`, you have an SSH key. + +If you don’t have yet an SSH key, you have to generate one: +```bash +$ ssh-keygen -t rsa # -b 4096 +``` + +Then, add the SSH key to Github/Gitlab. + +<img src="slides/img/icon-live-demo.png" height="100px"> \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/slides/essential_commands.md b/2020/2020-03-30_basicGitTraining/slides/essential_commands.md new file mode 100644 index 0000000000000000000000000000000000000000..0fa56f47884b92c3b64762cf696fed6f7a014b7b --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/essential_commands.md @@ -0,0 +1,98 @@ +# The 5 essential commands + + +**Yes**, you only need 5 commands! + +`pull, status, add, commit, push` + +or in other words (remember these!): +```bash +$ git pull <remote> <branch> +$ git status +$ git add myFile.md # example +$ git commit -m "myMessage" # example +$ git push <remote> <branch> +``` + + + +# Pull the latest version of an existing branch + +Pull the latest revision on branch `myBranch`: +```bash +$ git pull origin myBranch +# Already up to date +``` + +<div class="fragment"> + +Verify its `status` with: +```bash +$ git status +``` + + + +# Modify a file + +Copy the file `template.md` in the folder `_attendees` and rename it with your firstname: + +```bash +$ cd _attendees +$ cp template.md myName.md +``` + +Then, make your changes with your favorite editor! + + + +# Add your file to the stage + +First, check the repository status +```bash +$ git status +# uncommitted changes (displayed in red) +``` + + +<div class="fragment"> + +Now, add the file (bring it on stage) +```bash +$ git add myName.md # replace myName +$ git status +# returns the same as before, generally in green (means staged) +``` + +<div class="fragment"> + +**ADVANCED**: If there have been more changes after the file has been added, you can see your changes in the terminal +```bash +$ git diff +``` +exit with `q` + + + +# Add a commit message + +```bash +$ git commit -m "Add the profile of <myName>" +$ git status +``` + + + +# Push your file to your fork + +```bash +$ git push origin myBranch +``` + +<div class="fragment"> + +**ADVANCED**: see the log of all the commits (and your last one) in the terminal +```bash +$ git log +``` +exit by typing `q`. \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/slides/forks.md b/2020/2020-03-30_basicGitTraining/slides/forks.md new file mode 100644 index 0000000000000000000000000000000000000000..46abc880bae9f185d52f44d43e6a547ba5a09b27 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/forks.md @@ -0,0 +1,79 @@ +# What is a `fork`? + +<img src="slides/img/fork.jpg" class="as-is" height="500em"/> +<!--http://www.cndajin.com/data/wls/246/22302193.jpg--> + + + +# Not really ... + +<img src="slides/img/fork-crossed.png" class="as-is" height="500em"/> + + + +# What is a `fork`? + +In general, when contributing to a repository, you only have **read** access. + +In other words, you can only **pull** (unless it is your own repository or access has been granted). + +In general, you **cannot write** changes. In other words, you do not have **push** access. + +You have to work on your **own copy**. + +In other words, you have to work on your own <font color="red">**fork**</font>. + + + +# How to get a fork? + +Browse to the original repository and click on the button `Fork`: + + + +<img src="slides/img/icon-live-demo.png" height="100px"> + + + +# Time to practice! + +Fork the practice repository: <br><br> +https://github.com/LCSB-BioCore/basic-git-practice + +Then, clone your fork to your home directory! + +<img src="slides/img/icon-live-demo.png" height="100px"> + +```bash +$ git clone git@github.com:<yourName>/basic-git-practice.git +``` + +Change to the practice directory with: +```bash +$ cd basic-git-practice +``` + + + +# A note on shortcuts ... + +<font color="red"> +Any other rudimentary method such as + +*'I simply download the `.zip` and unzip it - works like a charm!'* + +shall **be avoided**! +</font> + +**Why?** + + + +# How to update my fork? + +As you have your own fork, it will not automatically be updated once the original repository is updated. + + You have to update it yourself! + +**More on that later!** + diff --git a/2020/2020-03-30_basicGitTraining/slides/github_gitlab.md b/2020/2020-03-30_basicGitTraining/slides/github_gitlab.md new file mode 100644 index 0000000000000000000000000000000000000000..84930c3922e96a6f2bb75d3ed85881aa19c2e2de --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/github_gitlab.md @@ -0,0 +1,18 @@ +# GitHub and GitLab + +<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub" style="width: 200px;"/> +<img src="https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-extra-whitespace.png" alt="GitLab" style="width: 200px;"/> + +GitHub and GitLab are VCS systems. + +GitHub/Gitlab are both **publicly available**, but GitLab can be **on-premise**. + +Positive point: GitHub and GitLab are (almost) the same. + + +<img src="slides/img/icon-live-demo.png" height="100px"> + + +- **GitHub**: [https://github.com](https://github.com) +- Public GitLab: [https://gitlab.com](https://gitlab.com) +- LCSB specific: [https://git-r3lab.uni.lu](https://git-r3lab.uni.lu) \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/slides/img/Git-Logo-Black.png b/2020/2020-03-30_basicGitTraining/slides/img/Git-Logo-Black.png new file mode 100644 index 0000000000000000000000000000000000000000..b7ed63f2d105656638665907bab77c5e4e375b3d Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/Git-Logo-Black.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/arianeLaunch.mov b/2020/2020-03-30_basicGitTraining/slides/img/arianeLaunch.mov new file mode 100644 index 0000000000000000000000000000000000000000..8b516a6c16ed1eb0cc1093dc8276fec214cb520e --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/img/arianeLaunch.mov @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff78e3c12e93a7548177269db5d4d1e6c0b36cee0802d6a0e02152623287390f +size 11346236 diff --git a/2020/2020-03-30_basicGitTraining/slides/img/branch-create.png b/2020/2020-03-30_basicGitTraining/slides/img/branch-create.png new file mode 100644 index 0000000000000000000000000000000000000000..bfea05c8f214876c9f53ef6a50aa5220b0eef976 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/branch-create.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/branch-master.png b/2020/2020-03-30_basicGitTraining/slides/img/branch-master.png new file mode 100644 index 0000000000000000000000000000000000000000..04ccddf15f4a487c8432bf111be3766b2424f53e Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/branch-master.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/branch-merge.png b/2020/2020-03-30_basicGitTraining/slides/img/branch-merge.png new file mode 100644 index 0000000000000000000000000000000000000000..92f31b5e457f0474e11c9b9d5415f2ad0f3efc85 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/branch-merge.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/bulb.png b/2020/2020-03-30_basicGitTraining/slides/img/bulb.png new file mode 100644 index 0000000000000000000000000000000000000000..590f8d9270fea6be86b5e356cb07cd9232ef7056 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/bulb.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/computerCode.png b/2020/2020-03-30_basicGitTraining/slides/img/computerCode.png new file mode 100644 index 0000000000000000000000000000000000000000..d7c9e74d328fc7742d4a416a62d0c72213dc9294 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/computerCode.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/favicon.ico b/2020/2020-03-30_basicGitTraining/slides/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..9b935c03f6f841601835db006ed02b582166cdc8 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/favicon.ico differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/fork-crossed.png b/2020/2020-03-30_basicGitTraining/slides/img/fork-crossed.png new file mode 100644 index 0000000000000000000000000000000000000000..cd93216af30439024a36d2d6355d0eae28324511 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/fork-crossed.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/fork.jpg b/2020/2020-03-30_basicGitTraining/slides/img/fork.jpg new file mode 100644 index 0000000000000000000000000000000000000000..35ef53f4225b9286280c99d2c23f1594d380d6c5 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/fork.jpg differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/git_definition.png b/2020/2020-03-30_basicGitTraining/slides/img/git_definition.png new file mode 100644 index 0000000000000000000000000000000000000000..0676fc7a299fae5c7c3389eed91e21fcb050c629 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/git_definition.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/github_app.png b/2020/2020-03-30_basicGitTraining/slides/img/github_app.png new file mode 100644 index 0000000000000000000000000000000000000000..3cc77f55371f4fdd960e778e4dfcfa5eee1adca4 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/github_app.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/icon-live-demo.png b/2020/2020-03-30_basicGitTraining/slides/img/icon-live-demo.png new file mode 100644 index 0000000000000000000000000000000000000000..4b9e6f031078329479b4cc8ea875b9657fda224a Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/icon-live-demo.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/installation.png b/2020/2020-03-30_basicGitTraining/slides/img/installation.png new file mode 100644 index 0000000000000000000000000000000000000000..dd278a70c5e8237d32c047759e47fb0812db9db0 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/installation.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/linus.jpg b/2020/2020-03-30_basicGitTraining/slides/img/linus.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5b1cb08a41ecbd2962e253e56ee61f336f1a523b Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/linus.jpg differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/logoLCSB.png b/2020/2020-03-30_basicGitTraining/slides/img/logoLCSB.png new file mode 100644 index 0000000000000000000000000000000000000000..9ca3f0adea7781ff00043b3f5465b28a89026287 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/logoLCSB.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/qualitybadge.png b/2020/2020-03-30_basicGitTraining/slides/img/qualitybadge.png new file mode 100644 index 0000000000000000000000000000000000000000..4c2aea855d8168733099d04286c9497338a8bf63 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/qualitybadge.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/r3-training-logo.png b/2020/2020-03-30_basicGitTraining/slides/img/r3-training-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..48a3aeaa54640a2bde1d4534dd9922d2ea90840c Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/r3-training-logo.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/redcross.png b/2020/2020-03-30_basicGitTraining/slides/img/redcross.png new file mode 100644 index 0000000000000000000000000000000000000000..9c4abc89436ea8c528992dbd7be484a1e2fe2c6b Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/redcross.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/reproCrisis.png b/2020/2020-03-30_basicGitTraining/slides/img/reproCrisis.png new file mode 100644 index 0000000000000000000000000000000000000000..d62dc06f732837b9380b15f8e21575db19710bd2 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/reproCrisis.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/snoopy.png b/2020/2020-03-30_basicGitTraining/slides/img/snoopy.png new file mode 100644 index 0000000000000000000000000000000000000000..af89c0b75a83f3339190f67987c306e1bd171c07 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/snoopy.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/therac.png b/2020/2020-03-30_basicGitTraining/slides/img/therac.png new file mode 100644 index 0000000000000000000000000000000000000000..cc9624e5907199ff4bae43ccc03d8ea80b45026b Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/therac.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/img/wheel.png b/2020/2020-03-30_basicGitTraining/slides/img/wheel.png new file mode 100644 index 0000000000000000000000000000000000000000..9c40a2d45e8b881ee055a58b376522ae0a69ef73 Binary files /dev/null and b/2020/2020-03-30_basicGitTraining/slides/img/wheel.png differ diff --git a/2020/2020-03-30_basicGitTraining/slides/index.md b/2020/2020-03-30_basicGitTraining/slides/index.md new file mode 100644 index 0000000000000000000000000000000000000000..3ce684cec9d9d0c51881eade69a326512399b687 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/index.md @@ -0,0 +1,19 @@ +# R3.school + +## March 30th, 2020 + +<div style="top: 6em; left: 0%; position: absolute;"> + <img src="theme/img/lcsb_bg.png"> +</div> + +<div style="top: 5em; left: 60%; position: absolute;"> + <img src="slides/img/r3-training-logo.png" height="200px"> + <br><br><br> + <h1>git training for beginners</h1> + <br><br><br><br> + <h4> + Laurent Heirendt, Ph.D.<br><br> + laurent.heirendt@uni.lu<br><br> + <i>Luxembourg Centre for Systems Biomedicine</i> + </h4> +</div> diff --git a/2020/2020-03-30_basicGitTraining/slides/installation.md b/2020/2020-03-30_basicGitTraining/slides/installation.md new file mode 100644 index 0000000000000000000000000000000000000000..506be614073e67dd22fc042230ccb1eb236a9792 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/installation.md @@ -0,0 +1,45 @@ +# Installation of `git` + +<img src="slides/img/github_app.png" class="as-is" height="200" /> + +**macOS** + +Install *Xcode Command Line Tools* + + +**Windows** + +Install Git Bash: <br>`https://git-scm.com/download/win` + + +**Linux (Ubuntu)** + +```bash +$ sudo apt-get install git-all +``` + + + +# How to get started? + +**macOS** + +Start the `Terminal` or `iTerm`. + + +**Windows** + +Start `GUI Bash`. + + +**Linux (Ubuntu)** + +Start the `Terminal` or `Terminator`. + + +**Is `git` properly installed?** + +```bash +$ git --version +# git version 2.10.0 +``` \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/slides/list.json b/2020/2020-03-30_basicGitTraining/slides/list.json new file mode 100644 index 0000000000000000000000000000000000000000..e06ee227643e58157bcacd9221c2d00ceff5d03a --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/list.json @@ -0,0 +1,65 @@ +[ + { + "filename": "index.md" + }, + { + "filename": "overview.md" + }, + { + "filename": "wheel.md" + }, + { + "filename": "repro_crisis.md" + }, + { + "filename": "whatiscode.md" + }, + { + "filename": "whyCare.md" + }, + { + "filename": "qualityCode.md" + }, + { + "filename": "what_is_git.md" + }, + { + "filename": "the_terminal.md" + }, + { + "filename": "the_editor.md" + }, + { + "filename": "installation.md" + }, + { + "filename": "github_gitlab.md" + }, + { + "filename": "configuration.md" + }, + { + "filename": "cloneRepo.md" + }, + { + "filename": "forks.md" + }, + { + "filename": "branches.md" + }, + { + "filename": "essential_commands.md" + }, + { + "filename": "merge.md" + }, + { + "filename": "syncFork.md" + }, + { + "filename": "best_practices.md" + }, + { + "filename": "thanks.md" + } +] diff --git a/2020/2020-03-30_basicGitTraining/slides/merge.md b/2020/2020-03-30_basicGitTraining/slides/merge.md new file mode 100644 index 0000000000000000000000000000000000000000..5b59e684ec66bb668ce48a929608f4de6f238807 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/merge.md @@ -0,0 +1,13 @@ +# Pull and merge requests + +If you want your changes to be reflected on the `develop` or `master` branches, +**submit a PR** via the Github interface. + +Use the **interface** to make use of your peers to review your code! +<img src="slides/img/branch-merge.png" class="branch-merge" height="500em"/> + +Once merged, you can delete the branch via the interface. + +<div class="fragment"> + +<img src="slides/img/icon-live-demo.png" height="100px" > \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/slides/overview.md b/2020/2020-03-30_basicGitTraining/slides/overview.md new file mode 100644 index 0000000000000000000000000000000000000000..569ee3789fd8f0a16e39ac938b9f7c5764adce04 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/overview.md @@ -0,0 +1,17 @@ +# Overview + +1. **PART I**: Quality of computer code. +2. **PART II**: Basic git course + 1. The terminal + 2. The editor + 3. What is `git`? What is the use of `git`? <!--(5 min)//--> + 4. Installation of `git` + 5. GitHub and GitLab <!--(5min)//--> + 6. How do I configure `git`? <!--(5min)//--> + 7. Where and how to start? <!--(5min)//--> + 8. What is a fork? <!--(5min)//--> + 9. What are branches? + 10. The 5 essential commands (`pull` / `status` / `add` / `commit` / `push`) + 11. What are merge/pull requests? <!--(10 min)//--> + 12. How do I synchronize my fork? + 13. Best practices \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/slides/qualityCode.md b/2020/2020-03-30_basicGitTraining/slides/qualityCode.md new file mode 100644 index 0000000000000000000000000000000000000000..24abf2c8bba903e0f4e213e3fc049ad7f253636b --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/qualityCode.md @@ -0,0 +1,34 @@ +# Quality of computer code is relevant for everyone. + +`This does not concern me – I am only writing documentation or a script for generating a figure that I want to publish!` +[Anonymous researcher] + +<div class="fragment"> + +**Great**, but ... + +- Figure may not be reproducible +- Figure looks different when the input data changes +- Documentation will become outdated + +… actually, **EVERYONE** writing documentation, a script, or code is concerned! + +<div align="center"> +<img src="slides/img/snoopy.png" height="400px"> +</div> + + + +# Attributes of high-quality computer code + +**Quality** of computer code can be seen as a **group of various attributes**. + +High-quality computer code should be: + +1. <font color="#A52A2A">**Versioned**</font>: incremental code +2. <font color="#FFA500">**Well-written**</font> (formatted, documented, commented): easy to read by a human +3. <font color="#008931">**Tested**</font>: extensively tested code + +<div align="center"> +<img src="slides/img/qualitybadge.png"> +</div> \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/slides/repro_crisis.md b/2020/2020-03-30_basicGitTraining/slides/repro_crisis.md new file mode 100644 index 0000000000000000000000000000000000000000..8e411c3b8a50de544cdc79ab423a97f97d0407af --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/repro_crisis.md @@ -0,0 +1,7 @@ +# Reproducibility crisis + +<div align="center"> +<img src="slides/img/reproCrisis.png"> +</div> + +*Baker, M., <a href="https://www.nature.com/news/1-500-scientists-lift-the-lid-on-reproducibility-1.19970">1,500 scientists lift the lid on reproducibility</a>, Nature 533, 452–454, 2016. doi:10.1038/533452a* \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/slides/syncFork.md b/2020/2020-03-30_basicGitTraining/slides/syncFork.md new file mode 100644 index 0000000000000000000000000000000000000000..a908869569972adac700f623ec73566b8af5d90c --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/syncFork.md @@ -0,0 +1,40 @@ +# Synchronize your fork + + Remember, we have to regularly update our own copy of the code. + + +Add the `upstream` address (original/protected repository) +```bash +$ git remote add upstream git@github.com:LCSB-BioCore/basic-git-practice.git +``` + + Note the change in the URL. + + +You can then check whether the remote address is set correctly +```bash +$ git remote -v +``` + +<div class="fragment"> + +Fetch the changes from upstream (similar to pull) +```bash +$ git fetch upstream +``` + + + + +Merge the retrieved changes on the `master` branch: +```bash +$ git checkout master +$ git merge upstream/master +$ git push origin master +``` + +<div class="fragment"> + +Do the same for the `develop` branch. + +<img src="slides/img/icon-live-demo.png" height="100px"> \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/slides/thanks.md b/2020/2020-03-30_basicGitTraining/slides/thanks.md new file mode 100644 index 0000000000000000000000000000000000000000..9f1d826bb46c503b32d1f228512970e726c00618 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/thanks.md @@ -0,0 +1,42 @@ +# Let's refresh our memories + +<div class="fragment"> + +- What is a **fork**? + +<div class="fragment"> + +- What are **branches**? + +<div class="fragment"> + +- Can I have **multiple branches** in my fork? + +<div class="fragment"> + +- What is a good **development scheme**? + +<div class="fragment"> + +- What are the **5 essential commands**? + + + +# References & Cheat sheet + +[1]: Git Book: https://git-scm.com/book/en/v2 + +[2]: GitHub training services: https://services.github.com/training/ + +[3]: Cheat sheet: http://rogerdudler.github.io/git-guide + + + +# Thank you. + +<img src="slides/img/r3-training-logo.png" height="200px"> + +Contact us if you need help: + +r3lab.core@uni.lu + diff --git a/2020/2020-03-30_basicGitTraining/slides/the_editor.md b/2020/2020-03-30_basicGitTraining/slides/the_editor.md new file mode 100644 index 0000000000000000000000000000000000000000..bca1b494ce0faed1f5806db841240fd513467d0d --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/the_editor.md @@ -0,0 +1,10 @@ +# The editor(s) + +Recommended editors: + +- **Visual Studio Code** (https://code.visualstudio.com) +- **Atom** (https://atom.io) + +*Note*: Other editors such as IntelliJ IDEA (https://www.jetbrains.com/idea) or Sublime Text (https://www.sublimetext.com) can, of course, also be used. + +<img src="slides/img/icon-live-demo.png" height="100px"> \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/slides/the_terminal.md b/2020/2020-03-30_basicGitTraining/slides/the_terminal.md new file mode 100644 index 0000000000000000000000000000000000000000..32e9979c1fc4d3eeb5286280c4b132bcb4fba8d5 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/the_terminal.md @@ -0,0 +1,81 @@ +# PART II + +<br><br><h1>Basic git course</h1> + + + +# The terminal (shell) + +**macOS users:** + +Start the Terminal from your `/Applications` directoy. + + Install iTerm2: `https://www.iterm2.com` + +**Windows users:** + +Install Git Bash: <br>`https://git-scm.com/download/win` + +**Linux users:** + +Launch default terminal.<br> + Install Terminator: `https://launchpad.net/terminator` + + + +# First steps in the terminal + +Starting the terminal presents itself with a line where you can enter a command +```bash +cesar@myComputer> +``` + +Often written, for covenience, as +```bash +$ +``` + +When you open your terminal (shell), you are located +in your home directory (unless otherwise configured), denoted as `~/`. + + + +# Essential Linux commands + +List the contents of a directory +```bash +$ ls #-lash +``` + +Create a directory +```bash +$ mkdir myNewDirectory +``` + +Change the directory to a specific folder +```bash +$ cd myNewDirectory +``` + +Change the directory 1 level and 2 levels up +```bash +$ cd .. +# 1 level up + +$ cd ../.. +# 2 levels up +``` + + + +Move a file or a directory +```bash +$ mv myFile.m myNewDirectory/. +``` + + +Rename a file or a directory +```bash +$ mv myFile.m myNewFile.m +$ mv myNewDirectory myDirectory +``` \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/slides/what_is_git.md b/2020/2020-03-30_basicGitTraining/slides/what_is_git.md new file mode 100644 index 0000000000000000000000000000000000000000..973cc0593ed0b3b993e870f74c9e0794301e278e --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/what_is_git.md @@ -0,0 +1,40 @@ +# What is `git`? + +<!--  --> + +`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** + +<div align="center"> +<img src="slides/img/linus.jpg"> +</div> + +[1] *https://en.wikipedia.org/wiki/Git* + + + +# The inventor of `git` + +<div align="center"> +<img src="slides/img/git_definition.png"> +</div> + +`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** +* Keep the changes you made over time (**history**) +* Allows you to **backtrack** (if necessary) and undo unwanted changes +* Easily **add contributions** of your collaborators to the main code base + +note: + +Other points to mention: +* git shall not be considered as a nuisance, but as a tool that should help to track and trace the code. +* git is not to track performance. Not using it shows exactly the opposite. diff --git a/2020/2020-03-30_basicGitTraining/slides/whatiscode.md b/2020/2020-03-30_basicGitTraining/slides/whatiscode.md new file mode 100644 index 0000000000000000000000000000000000000000..8a7ec810845093821daaaba558c5c1fe777500c1 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/whatiscode.md @@ -0,0 +1,15 @@ +# What is computer code? + +**Computer code**: Set of instructions executed by a computer + +**Programming language:**: Style of writing the set of instructions (e.g., C, C++, Fortran, Python, R, Matlab, Julia, …) + +**Example:** + +<div align="center"> +<img src="slides/img/computerCode.png"> +</div> + +<div class="fragment"> + +<div align="center"><font color="#A52A2A"><span class="fas fa-arrow-right"></span> Maybe this is not so relevant … or even, why should I care?</font></div> diff --git a/2020/2020-03-30_basicGitTraining/slides/wheel.md b/2020/2020-03-30_basicGitTraining/slides/wheel.md new file mode 100644 index 0000000000000000000000000000000000000000..789873bca8091e220bf2f81085af88a9ccd66953 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/wheel.md @@ -0,0 +1,20 @@ +# PART I + +<br><br><h1>Quality of computer code.</h1><br> +<h1>Should you care? What if you didn't?</h1> + + + +# A true story ... + +<div align="center"> +<img src="slides/img/wheel.png"> +</div> + +<table style="width:100%"> + <tr> + <th width="33%" align="center">Researcher who cares about<br>quality of his code</th> + <th width="33%" align="center">Fellow researcher</th> + <th width="33%" align="center">Pi or Manager</th> + </tr> +</table> \ No newline at end of file diff --git a/2020/2020-03-30_basicGitTraining/slides/whyCare.md b/2020/2020-03-30_basicGitTraining/slides/whyCare.md new file mode 100644 index 0000000000000000000000000000000000000000..75d3c6b492993927a4d793c470fe5a2996a2f721 --- /dev/null +++ b/2020/2020-03-30_basicGitTraining/slides/whyCare.md @@ -0,0 +1,33 @@ +# Why you should care (1) + +<div align="center"> +<video width="40%" controls> + <source src="slides/img/arianeLaunch.mov" type="video/mp4"> +Your browser does not support the video tag. +</video> +</div> + +**Aerospace Application**: First launch of Ariane 5, 1996 + +<font color="#A52A2A"><span class="fas fa-times-circle"></span></font> **Problem**: Rocket exploded shortly after liftoff. + +<font color="#FFA500"><span class="fas fa-exclamation-triangle"></span></font> **Root cause of disaster - Software error:** + +Horizontal velocity of the rocket exceeded the limits of the 16-bit signed integer value and led to overflow +Ariane 5 launched with the same software as Ariane 4 - **the code had not been tested** + + + +# Why you should care (2) + +<div align="center"> +<img src="slides/img/therac.png"> +</div> + +**Biotechnology Application**: Therac-25 – computer controlled radiation therapy machine + +<font color="#A52A2A"><span class="fas fa-times-circle"></span></font> **Problem**: Device malfunctions and delivers a lethal dose of radiation - several patients died. + +<font color="#FFA500"><span class="fas fa-exclamation-triangle"></span></font> **Root cause of disaster - Software error:** + +**No testing** of software before release, **lack of documentation**