diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/best_practices.md b/2020/2020-01-31_gitTrainingBioTech/slides/best_practices.md new file mode 100644 index 0000000000000000000000000000000000000000..0a738b8de90ea3bafa99a06401a4bcbb770b9510 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/best_practices.md @@ -0,0 +1,9 @@ +# Best practices + +* Fetch the upstream before creating a new branch. +* Work on your <font color="red">own</font> branch (in your own fork), and **not** on `master` and **not** on `develop` +* Get your code **reviewed** by your peers (submit a PR!) +* Submit a PR **often**! +* `Push` often - avoid conflicts + +Remember: **A `push` a day keeps conflicts away!** diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/branches.md b/2020/2020-01-31_gitTrainingBioTech/slides/branches.md new file mode 100644 index 0000000000000000000000000000000000000000..2914f86a87b518871d853409a150edef41441104 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/branches.md @@ -0,0 +1,57 @@ +# 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/text is referred to as a **branch**. + +<div class="fragment"> + +<font color="red">In the `howto-cards-internal` 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 + +<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** and start editing!</font> + + +<img src="slides/img/icon-live-demo.png" height="100px"> + +<img src="slides/img/branch-create.png" class="branch-create" height="500em"/> diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/configuration.md b/2020/2020-01-31_gitTrainingBioTech/slides/configuration.md new file mode 100644 index 0000000000000000000000000000000000000000..fa20360e7bb59f5709e8cbd4ff02e33f4f617b42 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/configuration.md @@ -0,0 +1,47 @@ +# 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`. + + + + +# 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 your profile on git-r3lab. + +On Windows, please unmount `P:\` (your personal atlas folder) first. + +<img src="slides/img/icon-live-demo.png" height="100px"> \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/forks.md b/2020/2020-01-31_gitTrainingBioTech/slides/forks.md new file mode 100644 index 0000000000000000000000000000000000000000..3126769401617b8d5af0b9c5c3adb754609627ef --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/forks.md @@ -0,0 +1,56 @@ +# What is a `fork`? + +<br><br> +<center><img src="slides/img/fork.jpg" class="as-is" height="500em"/></center> +<!--http://www.cndajin.com/data/wls/246/22302193.jpg--> + + + +# Not really ... + +<br><br> +<center><img src="slides/img/fork-crossed.png" class="as-is" height="500em"/></center> + + + +# 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>. + +<br> +<h2>How to get a fork?</h1> + +Browse to the original repository and click on the button `Fork`: + + + + + + +# 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! + +<img src="slides/img/icon-live-demo.png" height="100px"> + +**More on that during the demo!** + + + + +# Time to practice! + +Fork the howto-cards (internal) repository: <br><br> +https://git-r3lab.uni.lu/R3-core/howto-cards-internal/ + +<img src="slides/img/icon-live-demo.png" height="100px"> \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/github_gitlab.md b/2020/2020-01-31_gitTrainingBioTech/slides/github_gitlab.md new file mode 100644 index 0000000000000000000000000000000000000000..84d86642256a06760191b503a5b1734b7a7b20c3 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/github_gitlab.md @@ -0,0 +1,17 @@ +# 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 online platforms for developing code using the version control system (VCS) `git`. + +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) +- **GitLab**: [https://gitlab.com](https://gitlab.com) + +At the LCSB, we use our own instance of Gitlab: [https://git-r3lab.uni.lu](https://git-r3lab.uni.lu) \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/img/branch-create.png b/2020/2020-01-31_gitTrainingBioTech/slides/img/branch-create.png new file mode 120000 index 0000000000000000000000000000000000000000..94210c3b85b53b1551afc1c588fe21b5a7837bf4 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/img/branch-create.png @@ -0,0 +1 @@ +../../../../2019/2019-06-11_basicGitTraining/slides/img/branch-create.png \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/img/branch-master.png b/2020/2020-01-31_gitTrainingBioTech/slides/img/branch-master.png new file mode 120000 index 0000000000000000000000000000000000000000..f2c6173c90bd98bb6a7725d350d72b21b41937c4 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/img/branch-master.png @@ -0,0 +1 @@ +../../../../2019/2019-06-11_basicGitTraining/slides/img/branch-master.png \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/img/branch-merge.png b/2020/2020-01-31_gitTrainingBioTech/slides/img/branch-merge.png new file mode 120000 index 0000000000000000000000000000000000000000..c700ef4fa3e46c3211beed737af3795ee7452b53 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/img/branch-merge.png @@ -0,0 +1 @@ +../../../../2019/2019-06-11_basicGitTraining/slides/img/branch-merge.png \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/img/bulb.png b/2020/2020-01-31_gitTrainingBioTech/slides/img/bulb.png new file mode 120000 index 0000000000000000000000000000000000000000..5e7f60560949805da58c198b42840f2f51e82835 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/img/bulb.png @@ -0,0 +1 @@ +../../../../2019/2019-06-11_basicGitTraining/slides/img/bulb.png \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/img/favicon.ico b/2020/2020-01-31_gitTrainingBioTech/slides/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..9b935c03f6f841601835db006ed02b582166cdc8 Binary files /dev/null and b/2020/2020-01-31_gitTrainingBioTech/slides/img/favicon.ico differ diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/img/fork-crossed.png b/2020/2020-01-31_gitTrainingBioTech/slides/img/fork-crossed.png new file mode 120000 index 0000000000000000000000000000000000000000..4f6dbe827a848525ffbbd761b06b911991b50bcd --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/img/fork-crossed.png @@ -0,0 +1 @@ +../../../../2019/2019-06-11_basicGitTraining/slides/img/fork-crossed.png \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/img/fork.jpg b/2020/2020-01-31_gitTrainingBioTech/slides/img/fork.jpg new file mode 120000 index 0000000000000000000000000000000000000000..56d2afbf49e7c526106ce3407936bbd0100366c9 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/img/fork.jpg @@ -0,0 +1 @@ +../../../../2019/2019-06-11_basicGitTraining/slides/img/fork.jpg \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/img/git_definition.png b/2020/2020-01-31_gitTrainingBioTech/slides/img/git_definition.png new file mode 120000 index 0000000000000000000000000000000000000000..58c5cfe2490fb91b2f7e695b6b64ee92905636de --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/img/git_definition.png @@ -0,0 +1 @@ +../../../../2019/2019-06-11_basicGitTraining/slides/img/git_definition.png \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/img/icon-live-demo.png b/2020/2020-01-31_gitTrainingBioTech/slides/img/icon-live-demo.png new file mode 120000 index 0000000000000000000000000000000000000000..7d3b35b3f45f22cb4c23f3791e26ad40473f5a42 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/img/icon-live-demo.png @@ -0,0 +1 @@ +../../../../2019/2019-06-11_basicGitTraining/slides/img/icon-live-demo.png \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/img/linus.jpg b/2020/2020-01-31_gitTrainingBioTech/slides/img/linus.jpg new file mode 120000 index 0000000000000000000000000000000000000000..ba123a497631578fed48d37e0155c527fbb7f067 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/img/linus.jpg @@ -0,0 +1 @@ +../../../../2019/2019-06-11_basicGitTraining/slides/img/linus.jpg \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/img/logoLCSB.png b/2020/2020-01-31_gitTrainingBioTech/slides/img/logoLCSB.png new file mode 120000 index 0000000000000000000000000000000000000000..8f3294191994322b5d3cc4e5eb2ec6ca93b405be --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/img/logoLCSB.png @@ -0,0 +1 @@ +../../../../2019/2019-06-11_basicGitTraining/slides/img/logoLCSB.png \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/img/r3-training-logo.png b/2020/2020-01-31_gitTrainingBioTech/slides/img/r3-training-logo.png new file mode 120000 index 0000000000000000000000000000000000000000..e13ef533e1bea95d25a3017ebfef472eb5cd6464 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/img/r3-training-logo.png @@ -0,0 +1 @@ +../../../../2019/2019-06-11_basicGitTraining/slides/img/r3-training-logo.png \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/index.md b/2020/2020-01-31_gitTrainingBioTech/slides/index.md new file mode 100644 index 0000000000000000000000000000000000000000..f8184f045d2066c6fd66936d83728f84bbbc3e3b --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/index.md @@ -0,0 +1,19 @@ +# R3.school + +## January 31st, 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 biotech team</h1> + <br><br><br><br> + <h4> + Laurent Heirendt, Ph.D.<br> + laurent.heirendt@uni.lu<br> + <i>Luxembourg Centre for Systems Biomedicine</i> + </h4> +</div> diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/list.json b/2020/2020-01-31_gitTrainingBioTech/slides/list.json new file mode 100644 index 0000000000000000000000000000000000000000..da096d2c5630cc33f153f8f502727b8523b09db7 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/list.json @@ -0,0 +1,17 @@ +[ + { "filename": "index.md" }, + { "filename": "overview.md" }, + { "filename": "what_is_git.md" }, + { "filename": "github_gitlab.md" }, + { "filename": "overview.md" }, + { "filename": "configuration.md" }, + { "filename": "overview.md" }, + { "filename": "forks.md" }, + { "filename": "overview.md" }, + { "filename": "branches.md" }, + { "filename": "overview.md" }, + { "filename": "merge.md" }, + { "filename": "overview.md" }, + { "filename": "best_practices.md" }, + { "filename": "thanks.md" } +] diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/merge.md b/2020/2020-01-31_gitTrainingBioTech/slides/merge.md new file mode 100644 index 0000000000000000000000000000000000000000..1b1e6d74751dd5e97b34ee74e32ad7653ac16ab6 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/merge.md @@ -0,0 +1,13 @@ +# Merge requests + +If you want your changes to be reflected on the `develop` or `master` branches, +**submit a MR** via the Gitlab 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-01-31_gitTrainingBioTech/slides/overview.md b/2020/2020-01-31_gitTrainingBioTech/slides/overview.md new file mode 100644 index 0000000000000000000000000000000000000000..9dfc54009639806e3f4fa32b1aaa770315a61b71 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/overview.md @@ -0,0 +1,20 @@ +# Overview + +1. Introduction 📚 + 1. What is `git`? What is the use of `git`? 📚 + 2. GitHub and GitLab 📚 +2. Installation & set up + - Configure git 💻 + - Configure an SSH key 💻 +3. Before starting to contribute to a repository + - What is a fork? 📚 + - Create and clone a fork 💻 +4. Contributing to a repository + - What are branches? 📚 + - Create a branch 💻 + - Create and edit a new card 💻 +5. Submit the contribution for review + - What is a merge request? 📚 + - Submit a merge request 💻 + - Review a merge request 💻 +6. Summary 📚 \ No newline at end of file diff --git a/2020/2020-01-31_gitTrainingBioTech/slides/thanks.md b/2020/2020-01-31_gitTrainingBioTech/slides/thanks.md new file mode 100644 index 0000000000000000000000000000000000000000..06677fb4d6f157a4005d73eb92ee232c1ab25608 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/thanks.md @@ -0,0 +1,29 @@ +# 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**? + + + + +# 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-01-31_gitTrainingBioTech/slides/what_is_git.md b/2020/2020-01-31_gitTrainingBioTech/slides/what_is_git.md new file mode 100644 index 0000000000000000000000000000000000000000..bfc8875cd0cbc1bbbe89750008c1692239aca831 --- /dev/null +++ b/2020/2020-01-31_gitTrainingBioTech/slides/what_is_git.md @@ -0,0 +1,47 @@ +# What is `git`? (i) + +<!--  --> + +`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* + + + +# What is `git`? (ii) + +<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.` +<br> +Linus Torvald (2007-06-14) + + + +# What is the use of `git`? + +* `git` can be used for code or text documents, such as markdown language + +* No need to fully rewrite code/text; **reuse code/text** 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 repository + +<br> +Other points: + +- `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.