diff --git a/.gitignore b/.gitignore index 72598cf3d625708f0d20916694db5a314d71c95c..ea3707a8ba9ded677c7922ded19397f2ffee8693 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.ai site/ courses.lcsb.uni.lu index.html diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/best_practices.md b/2022/2022-05-31_git-trilogy-part-1/slides/best_practices.md new file mode 100644 index 0000000000000000000000000000000000000000..c20cfef1c037bbad180aa782d5351d719b6e26af --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/best_practices.md @@ -0,0 +1,20 @@ + +# Summary + +GitLab creates a convenient and efficient working environment + - merge requests + - issues + - assignments + - much much more... + + + +# Best practices + +* Work on your <font color="red">own</font> branch (in your own fork), and **not** on `master` and **not** on `develop` +* Do **not commit** to `master`/`develop`, but **submit a merge request (MR)** +* Get your code **reviewed** by your peers (submit a merge request!) +* Submit a merge request **often**! (as soon as the feature is ready) +* Make commits often (keeps increments small) + + diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/branches.md b/2022/2022-05-31_git-trilogy-part-1/slides/branches.md new file mode 100644 index 0000000000000000000000000000000000000000..712173397c1a1db3a0552b61a3c14b80985aef04 --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/branches.md @@ -0,0 +1,88 @@ +# New term: <font color="color:red">branch</font> + +* A sequence of commits (changes) is referred to as *branch*. +* A new branch can be created by *branching off* from a commit on another branch. +* A *branch* can be understood as a named *version* of your repository. + +<div style="position:absolute;left:50%;top:1em"> +<img src="slides/img/branch_branch-off_detail.png" class="as-is" height="800px"/> +</div> + + + +# Development scheme + +Generally, in a repository, there are guidelines for contributing. + +<br> + +A common development scheme is dual with a: + +- **development** version on `develop` + - things are still being changed and mistakes are being fixed +- **stable** version on `master` + - actively used version in production environment + + +<div class="fragment"> +<div style="position:absolute;left:60%;top:1em"> +<img src="slides/img/branch_master-develop.png" height="800px"> +</div> + +<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! + + + +# Create your own version + +Assume that you want to work on a new content. + +Best practice is to <font color="red">create a new **branch**!</font> + +<div class="fragment"> +<div style="position:absolute;left:60%;top:1em"> +<img src="slides/img/branch_my-branch.png" height="800em"/> +</div> + +<br> + +Using branches ensures: +* your changes are made separately from other (unrelated) changes +* your version will not be affected by other contributors +* all related changes are aggregated in one place +* work can continue if the development of one feature gets stuck + +<br> +Are you working on more features in parallel? + +<font color="red">Create a new **branch**!</font> for each of them! + + + + + +# Quick recap + +What is the difference between a *fork* and a *branch*? + +<div class="fragment"> +<br><br><br> +<div align="center"> +<img src="slides/img/forking_detail-with-branches.png" height="500em"/> +</div> + + + + +# How to switch between branches? + +<div align="center"> +<img src="slides/img/branch_GUI_switch.png" height="500em"/> +</div> + + + Why is it best practice to branch off from `develop`? \ No newline at end of file diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/commit.md b/2022/2022-05-31_git-trilogy-part-1/slides/commit.md new file mode 100644 index 0000000000000000000000000000000000000000..7c1fd0be48dd30af338ad211b3644b70166540db --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/commit.md @@ -0,0 +1,51 @@ +# New term: <font color="color:red">commit</font> + +* Your repository (your file) is in a certain state. +* Every change moves the repository to a new state. +* Every change added to the sequence of changes is called **commit**. +* Every commit has: + * content - what? + * a message - why? + * an author - who? + * a timestamp - when? + * unique identifier - tracking number + +<div style="position:absolute;left:60%;top:1em"> +<img src="slides/img/commit_history-diagram.png" class="as-is" height="800px"/> +</div> + +<div class="fragment"> +Gitlab: +<div style="position:absolute"> +<img src="slides/img/commit_GUI_1.png" class="as-is" height="350px"/> +</div> +</div> + + + +# New term: <font color="color:red">commit</font> + +<img src="slides/img/icon-live-demo.png" height="100px"> + +1. Notice last commits that modified files/folders +<!-- .element: class="fragment" data-fragment-index="1" --> +1. Review history of your repository +<!-- .element: class="fragment" data-fragment-index="2" --> +1. See changes in the last/second last/third last commit. +<!-- .element: class="fragment" data-fragment-index="3" --> + + +<div class="fragment fade-in-then-out" style="position:absolute;left:50%;top:1em" data-fragment-index="1"> + <img src="slides/img/commit_GUI_main-last-commit.png" class="as-is" height="500px"/> +</div> + +<div class="fragment fade-in-then-out" style="position:absolute;left:50%;top:1em" data-fragment-index="2"> + <img src="slides/img/commit_GUI_main-history.png" class="as-is" height="500px"/> +</div> + +<div class="fragment fade-in-then-out" style="position:absolute;left:50%;top:4em" data-fragment-index="3"> +<img src="slides/img/commit_GUI_click-on-commit.png" class="as-is" height="75px"/> +</div> +<div class="fragment fade-in-then-out" data-fragment-index="3"> +<img src="slides/img/commit_changes.png" class="as-is" width="90%"/> +</div> diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/example.md b/2022/2022-05-31_git-trilogy-part-1/slides/example.md new file mode 100644 index 0000000000000000000000000000000000000000..039aa89c7ef8a28fc91df2cbe25b38fbc8ce498c --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/example.md @@ -0,0 +1,10 @@ +# Complete example + +Task: add your name to the list of attendees in the practice repository. + +- Repository: [https://gitlab.lcsb.uni.lu/R3/school/git/basic-practice-pages](https://gitlab.lcsb.uni.lu/R3/school/git/basic-practice-pages) +- Development Branch: `develop` +- Website: [https://r3.pages.uni.lu/school/git/basic-practice-pages](https://r3.pages.uni.lu/school/git/basic-practice-pages) + + +<img src="slides/img/icon-live-demo.png" height="100px"> diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/forks.md b/2022/2022-05-31_git-trilogy-part-1/slides/forks.md new file mode 100644 index 0000000000000000000000000000000000000000..a778f65bbd610465c1d52ecb7cad345fa71b50f3 --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/forks.md @@ -0,0 +1,65 @@ +# New term: <font color="color:red">fork</font> +## What is a `fork`? + +<center> +<img src="slides/img/fork.jpg" class="as-is" height="500em"/> +</center> + + + +# New term: <font color="color:red">fork</font> +## Not really ... + +<center> +<img src="slides/img/fork-crossed.png" class="as-is" height="500em"/> +</center> + + + +# New term: <font color="color:red">fork</font> +## What is a `fork`? + +- In general, by default, you can only **read** files in a repository. You **cannot write**. + +<div class="fragment"> +<div align="center"> +<img src="slides/img/forking.png" width="80%"> +</div> + +- You have to work on your **own copy** of the repository in order to make changes. +- 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`: + +<div align="center"> +<img src="https://docs.gitlab.com/ee/user/project/repository/img/forking_workflow_fork_button_v13_10.png" height="150"> +</div> + +<br> + +<img src="slides/img/icon-live-demo.png" height="100px"> + + +## Time to practice! + +1. Fork the training repository [https://gitlab.lcsb.uni.lu/R3/school/git/basic-practice-pages](https://gitlab.lcsb.uni.lu/R3/school/git/basic-practice-pages) + + +Congrats! Now you have your own **fork**! + + + +# How to update my fork? + +As you have your own copy (fork), it will not automatically be updated once the original repository is updated. + + You have to update it yourself! + +<br> + +**More on that later - time permitting** diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/gitlab.md b/2022/2022-05-31_git-trilogy-part-1/slides/gitlab.md new file mode 100644 index 0000000000000000000000000000000000000000..f36b003e4a54b16b850ddf5c88a63489c49cbd1f --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/gitlab.md @@ -0,0 +1,37 @@ +# Git repository hosting platforms + +<div style="position:absolute; left:70%"> +<img src="https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-extra-whitespace.png" alt="GitLab" style="width: 500px;"/> +</div> + +Web-based platforms with **many** features facilitating storing, tracking and collaborating on `git` repositories. + +* cloud based - everything on remote server +* authentication and authorization - who can see or access the repository and how +* access to files via browser - manage, view, make changes, ... +* collaboration supporting features - comment, create issues, documentation, ... + +**Gitlab** is both publicly available or can be deployed on-premise. + +- Public GitLab: [https://gitlab.com](https://gitlab.com) +- **LCSB** specific: [https://gitlab.lcsb.uni.lu](https://gitlab.lcsb.uni.lu) + +Other popular platforms: +- **GitHub**: [https://github.com](https://github.com) +- **BitBucket**: [https://bitbucket.org](https://bitbucket.org) +- **Gitea**: [https://gitea.io](https://gitea.io) + + + +# Login and report and issue + +1. Login to [https://gitlab.lcsb.uni.lu](https://gitlab.lcsb.uni.lu) + * use your LUMS credentials +2. Browse the existing repositories + * Explore and Search + * Navigate to the training repository [https://gitlab.lcsb.uni.lu/R3/school/git/basic-practice-pages](https://gitlab.lcsb.uni.lu/R3/school/git/basic-practice-pages) +3. Inspect project/repository folder structure +4. Report an issue + +<img src="slides/img/icon-live-demo.png" height="100px"> + diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/Git-logo.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/Git-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..910f9936950b6e6cc5697c2e6bc761b7f80b9d76 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/Git-logo.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_GUI_switch.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_GUI_switch.png new file mode 100644 index 0000000000000000000000000000000000000000..025ba5da34d35abecee4901133634dcd5056f2f2 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_GUI_switch.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_branch-off_detail.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_branch-off_detail.png new file mode 100644 index 0000000000000000000000000000000000000000..27ac109e180a42f442ed9a5cfcce58cb94a35e67 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_branch-off_detail.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_master-develop.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_master-develop.png new file mode 100644 index 0000000000000000000000000000000000000000..60079f423db6516aca238700363e7c50a5cb8e62 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_master-develop.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_merge-detail.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_merge-detail.png new file mode 100644 index 0000000000000000000000000000000000000000..3e788295f42607e40c74254960782c7122aaba86 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_merge-detail.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_my-branch.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_my-branch.png new file mode 100644 index 0000000000000000000000000000000000000000..bd1e0d3b425f4128d0ca33393dd9f95a005d1c73 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/branch_my-branch.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/bulb.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/bulb.png new file mode 100644 index 0000000000000000000000000000000000000000..590f8d9270fea6be86b5e356cb07cd9232ef7056 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/bulb.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_1.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_1.png new file mode 100644 index 0000000000000000000000000000000000000000..507aa900aaaea1b74698ea1d2ca0b5b835093ca8 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_1.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_click-on-commit.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_click-on-commit.png new file mode 100644 index 0000000000000000000000000000000000000000..079f48ed1a0f5a7d8250aa474afffe7aaa02aa79 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_click-on-commit.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_main-history.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_main-history.png new file mode 100644 index 0000000000000000000000000000000000000000..29435f1b7167a25b8d340597776fa6418272d713 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_main-history.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_main-last-commit.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_main-last-commit.png new file mode 100644 index 0000000000000000000000000000000000000000..a3014f4f1f3ed761fc901c924c7ee0ddc3a5fc48 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_main-last-commit.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_web-ide.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_web-ide.png new file mode 100644 index 0000000000000000000000000000000000000000..0891d44db40a3f9127ca1f0234106d9acfc1fcc0 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_web-ide.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_changes.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_changes.png new file mode 100644 index 0000000000000000000000000000000000000000..f00a383ac3aba3fc227fe2b8a6dd2428a564e9af Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_changes.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_history-diagram.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_history-diagram.png new file mode 100644 index 0000000000000000000000000000000000000000..d9eef88b74d5d36139d50e5ef1160c204f498c58 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/commit_history-diagram.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/favicon.ico b/2022/2022-05-31_git-trilogy-part-1/slides/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..9b935c03f6f841601835db006ed02b582166cdc8 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/favicon.ico differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/fork-crossed.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/fork-crossed.png new file mode 100644 index 0000000000000000000000000000000000000000..cd93216af30439024a36d2d6355d0eae28324511 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/fork-crossed.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/fork.jpg b/2022/2022-05-31_git-trilogy-part-1/slides/img/fork.jpg new file mode 100644 index 0000000000000000000000000000000000000000..35ef53f4225b9286280c99d2c23f1594d380d6c5 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/fork.jpg differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/fork_branch-diagram-after-commit-with-back-arrow.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/fork_branch-diagram-after-commit-with-back-arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..9b2cc2475efff822f8eff39d8b810efad1c8e6f3 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/fork_branch-diagram-after-commit-with-back-arrow.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/fork_branch-diagram-after-commit.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/fork_branch-diagram-after-commit.png new file mode 100644 index 0000000000000000000000000000000000000000..ee32953aa2c028088d422424cae11f0fe57e448e Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/fork_branch-diagram-after-commit.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/forking.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/forking.png new file mode 100644 index 0000000000000000000000000000000000000000..99f25a1a3140d044c2c5954f4162f6d8780ecea5 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/forking.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/forking_detail-with-branches.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/forking_detail-with-branches.png new file mode 100644 index 0000000000000000000000000000000000000000..4a974d117c286990688cc29fb7eb19c9efabdde0 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/forking_detail-with-branches.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/git_definition.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/git_definition.png new file mode 100644 index 0000000000000000000000000000000000000000..0676fc7a299fae5c7c3389eed91e21fcb050c629 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/git_definition.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/icon-live-demo.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/icon-live-demo.png new file mode 100644 index 0000000000000000000000000000000000000000..4b9e6f031078329479b4cc8ea875b9657fda224a Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/icon-live-demo.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/icon-repo.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/icon-repo.png new file mode 100644 index 0000000000000000000000000000000000000000..fb042be31721ba8711186b448444ae59d4b69038 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/icon-repo.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/linus.jpg b/2022/2022-05-31_git-trilogy-part-1/slides/img/linus.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5b1cb08a41ecbd2962e253e56ee61f336f1a523b Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/linus.jpg differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/merge_detail.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/merge_detail.png new file mode 100644 index 0000000000000000000000000000000000000000..3e788295f42607e40c74254960782c7122aaba86 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/merge_detail.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/r3-training-logo.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/r3-training-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..48a3aeaa54640a2bde1d4534dd9922d2ea90840c Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/r3-training-logo.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/version-history_OneDrive.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/version-history_OneDrive.png new file mode 100644 index 0000000000000000000000000000000000000000..f24e69c329a76cefc40f4da21d45e6878c0f4fb1 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/version-history_OneDrive.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/web-ide_commit-button.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/web-ide_commit-button.png new file mode 100644 index 0000000000000000000000000000000000000000..23e775e6062402145a85286f595271723eee37e4 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/web-ide_commit-button.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/web-ide_commit-detail.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/web-ide_commit-detail.png new file mode 100644 index 0000000000000000000000000000000000000000..80ec49c23dfd5286afba4a63ee6de07f40398b62 Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/web-ide_commit-detail.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/web-ide_edit-file.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/web-ide_edit-file.png new file mode 100644 index 0000000000000000000000000000000000000000..bf5f4d1acbed2cd79579c4dd930ba1ddc70611ef Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/web-ide_edit-file.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/img/web-ide_select-branch.png b/2022/2022-05-31_git-trilogy-part-1/slides/img/web-ide_select-branch.png new file mode 100644 index 0000000000000000000000000000000000000000..9ebef3460496902df4fd2e1cd5457f9e4bff0b0f Binary files /dev/null and b/2022/2022-05-31_git-trilogy-part-1/slides/img/web-ide_select-branch.png differ diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/index.md b/2022/2022-05-31_git-trilogy-part-1/slides/index.md new file mode 100644 index 0000000000000000000000000000000000000000..1ab581759602271205ba4aa36c5d9b9bf570da82 --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/index.md @@ -0,0 +1,20 @@ +# R3.school + +## May 31st, 2022 + +<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><br> + <h1>Trilogy of git - Part I</h1> + <h2>Contribute using Gitlab</h2> + <br><br><br> + <h4> + Laurent Heirendt, Ph.D.<br> + R3 Team - <a href="mailto:lcsb-r3@uni.lu">lcsb-r3@uni.lu</a><br> + <i>Luxembourg Centre for Systems Biomedicine</i> + </h4> +</div> \ No newline at end of file diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/list.json b/2022/2022-05-31_git-trilogy-part-1/slides/list.json new file mode 100644 index 0000000000000000000000000000000000000000..9f605d9b927e3df688fa6afadd2147285c35c9d0 --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/list.json @@ -0,0 +1,16 @@ +[ + { "filename": "index.md" }, + { "filename": "versioning.md" }, + { "filename": "what_is_git.md" }, + { "filename": "repository.md" }, + { "filename": "gitlab.md" }, + { "filename": "forks.md" }, + { "filename": "commit.md"}, + { "filename": "branches.md" }, + { "filename": "web-ide.md" }, + { "filename": "merge.md" }, + { "filename": "example.md" }, + { "filename": "syncFork.md" }, + { "filename": "best_practices.md" }, + { "filename": "thanks.md" } +] diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/merge.md b/2022/2022-05-31_git-trilogy-part-1/slides/merge.md new file mode 100644 index 0000000000000000000000000000000000000000..204482b5c233171a89f661f211a463cca0c33509 --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/merge.md @@ -0,0 +1,44 @@ +# New term: <font color="color:red">merge</font> + +* You have made changes on your branch +* Now you want your changes to be reflected on another branch </br>(most probably `develop`) + +<div style="position:absolute;left:70%;top:1em"> +<img src="slides/img/branch_merge-detail.png" height="800px" > +</div> + +You have to <font color="color:red">merge</font> the branches. + +- Merging is directional - *Merge branch A to branch B* +- Merging of branches is a process that is initiated via a so called **merge request** (MR): +- Your peers can comment on your changes in a merge request **review**! + + + +# What happened in the background? + +<div align="center"> +<img src="slides/img/fork_branch-diagram-after-commit.png" height="600px" > +</div> + + + +# What happened in the background? + +<div align="center"> +<img src="slides/img/fork_branch-diagram-after-commit-with-back-arrow.png" height="600px" > +</div> + + + +# Merge request (MR) + +<img src="slides/img/icon-live-demo.png" height="100px"> + +After hitting the *Commit* button, you get redirected to the submission page for your *merge request (MR)* + +* Propose to merge your branch into the *development branch*. This is shown at the top of the page. +* Fill your merge request submission form and select an *Assignee*. +* Under Changes tab, you can see your changes + + Good practice is to select *Delete source branch when merge request is accepted*. Why? diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/repository.md b/2022/2022-05-31_git-trilogy-part-1/slides/repository.md new file mode 100644 index 0000000000000000000000000000000000000000..04938227de8ec36475e5e92b4fa3cffdd41df277 --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/repository.md @@ -0,0 +1,5 @@ +# New term: <font color="color:red">repository</font> + +<div style="position:relative;text-align:center;top:10em"> +Project folder keeping all your files and their history +</div> diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/syncFork.md b/2022/2022-05-31_git-trilogy-part-1/slides/syncFork.md new file mode 100644 index 0000000000000000000000000000000000000000..1b3ef3de4b0d696758d481da41c7ebfd844dc666 --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/syncFork.md @@ -0,0 +1,19 @@ +# Synchronize your fork + +As mentioned earlier, your fork has been created a certain moment in time. + +How to keep it updated? + +## Easy way + +Delete your fork and re-create it! + +- Go to `Settings > General` +- Scroll down to the `Advanced` section and expand it +- Click on `Delete this project` and follow the on-screen instructions + + Before you do this, please make sure that all your merge requests have been accepted. + +## Automatic way + +Follow the instructions on the How-To card: [https://howto.lcsb.uni.lu/?contribute:mirror-fork](https://howto.lcsb.uni.lu/?contribute:mirror-fork) \ No newline at end of file diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/thanks.md b/2022/2022-05-31_git-trilogy-part-1/slides/thanks.md new file mode 100644 index 0000000000000000000000000000000000000000..542789e5512f6c5c808baa9e8995a55a2a41f761 --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/thanks.md @@ -0,0 +1,8 @@ +# Thank you. + +<center><img src="slides/img/r3-training-logo.png" height="200px"></center> + +Contact us if you need help: + +<a href="mailto:lcsb-r3@uni.lu">lcsb-r3@uni.lu</a> + diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/versioning.md b/2022/2022-05-31_git-trilogy-part-1/slides/versioning.md new file mode 100644 index 0000000000000000000000000000000000000000..53b1415c53bee230d4d280412a4a476fc7facf88 --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/versioning.md @@ -0,0 +1,97 @@ +# Why use a version control system? + +Basic features: + +* Maintain different versions of documents or code +* Ability to recover previous versions +* Track all changes to a document or code + +<div style="position:absolute; left:50%"> +<img src="slides/img/version-history_OneDrive.png" height="650px"> +</div> + +Common tools you are already using supporting "version control": + +* Owncloud +* OneDrive +* ... + +From the list of files, it is clear *who* changed which file and *when*. + + +<div class="fragment"> + +But some information is missing: + +- *What exactly* was changed? (which section or row?) +- *Why* was it changed? + + + +# Why use a version control system? + +## Manual file versioning + CHANGELOG + +<br> + +<div style="position:absolute; width:30%"> + +Your folder: +``` +my-document_v01.docx +my-document_v02.docx +... +my-document_v12.docx +CHANGELOG.txt +``` +</div> +<div style="position:relative; left:40%; width:60%""> + +CHANGELOG.txt: +``` +v01 -> v02 +- Chapter 1 updated to contain last findings +- fixing typo on page 3 + +v02 -> v03 +- rephrasing section 2 to adhere to standard +- add missing diagram +... +``` +</div> + +<br> +<br> + +<div class="fragment"> + +**What exactly** has changed? - Solved! + +**Why** it was changed? - Solved! +</div> +<div class="fragment"> +Really? + +note: overhead for doing this manually is huge +</div> + + + +# Using versioning system? + +What happens when **3** people contribute? + +``` +my-document_v01_AK.docx +my-document_v01_AK_BP.docx +my-document_v02_revised.docx +my-document_v02_LP_revised-and-approved.docx +my-document_v002_draft_LP-AK_do-not-touch.docx +... +my-document_v12_we-made-it.docx +CHANGELOG.txt +``` + +<div class="fragment"> + +What happens when **10** people contribute? \ No newline at end of file diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/web-ide.md b/2022/2022-05-31_git-trilogy-part-1/slides/web-ide.md new file mode 100644 index 0000000000000000000000000000000000000000..f900de0871070ff24d307a1210005dd0c1eba303 --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/web-ide.md @@ -0,0 +1,39 @@ +# Workflow - Web IDE + +To change content of a file: + +* Browse to *your fork* +* Open Web IDE +<!-- .element: class="fragment" data-fragment-index="1" --> +* Select the development branch +<!-- .element: class="fragment" data-fragment-index="2" --> +* Edit file content +<!-- .element: class="fragment" data-fragment-index="3" --> +* Commit +<!-- .element: class="fragment" data-fragment-index="4" --> + * Click Commit + * Select **Create a new branch** + * Type your branch name (optional, but recommended) + * Check **Start a new merge request** + * Click Commit + + +<div style="position:absolute;left:30%;top:1em" class="fragment fade-in-then-out" data-fragment-index="1"> +<img src="slides/img/commit_GUI_web-ide.png" width="95%" > +</div> + +<div style="position:absolute;left:40%;top:1em" class="fragment fade-in-then-out" data-fragment-index="2"> +<img src="slides/img/web-ide_select-branch.png" width="60%" > +</div> + +<div style="position:absolute;left:33%;top:1em" class="fragment fade-in-then-out" data-fragment-index="3"> +<img src="slides/img/web-ide_edit-file.png" width="90%" > +</div> + +<div style="position:absolute;left:50%;top:1em" class="fragment fade-in-then-out" data-fragment-index="4"> +<img src="slides/img/web-ide_commit-button.png" width="90%" > +</div> + +<div style="position:absolute;left:50%;top:10em" class="fragment fade-in-then-out" data-fragment-index="4"> +<img src="slides/img/web-ide_commit-detail.png" width="90%" > +</div> diff --git a/2022/2022-05-31_git-trilogy-part-1/slides/what_is_git.md b/2022/2022-05-31_git-trilogy-part-1/slides/what_is_git.md new file mode 100644 index 0000000000000000000000000000000000000000..62bf14050d51f0d7c17ad4d1ed75e070aee141b9 --- /dev/null +++ b/2022/2022-05-31_git-trilogy-part-1/slides/what_is_git.md @@ -0,0 +1,49 @@ +# 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 Torvalds (2007-06-14) + + + +# What is the use of `git`? + +<div align="center"> +<img src="slides/img/Git-logo.png" height="120"> +</div> + +* Ability to recover old versions +* No need to fully rewrite text or code; **reuse** and **save time** +* Keep the changes you made over time (**history**) to every single line +* Annotate each change with description +* **Backtrack** (if necessary) and undo unwanted changes +* Contribute content in parallel +* Easily **add contributions** of your collaborators to any version + + +note: + +Other points to mention: + +* git stems from SW development domain with >100 of people contributing to one project +* 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.