Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • R3/school/courses
  • vilem.ded/courses
  • todor.kondic/courses
  • noua.toukourou/courses
  • nene.barry/courses
  • laurent.heirendt/courses
  • marina.popleteeva/courses
  • jenny.tran/courses
8 results
Show changes
Commits on Source (78)
Showing
with 272 additions and 0 deletions
*.ai
site/
courses.lcsb.uni.lu
index.html
......
# 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)
# 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">
![bulb](slides/img/bulb.png) 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>
![bulb](slides/img/bulb.png) Why is it best practice to branch off from `develop`?
\ No newline at end of file
# 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>
# 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">
# 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.
![bulb](slides/img/bulb.png) You have to update it yourself!
<br>
**More on that later - time permitting**
# 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">
2022/2022-05-31_git-trilogy-part-1/slides/img/Git-logo.png

5.55 KiB

2022/2022-05-31_git-trilogy-part-1/slides/img/branch_GUI_switch.png

140 KiB

2022/2022-05-31_git-trilogy-part-1/slides/img/branch_master-develop.png

16.1 KiB

2022/2022-05-31_git-trilogy-part-1/slides/img/branch_merge-detail.png

16.6 KiB

2022/2022-05-31_git-trilogy-part-1/slides/img/branch_my-branch.png

18.2 KiB

2022/2022-05-31_git-trilogy-part-1/slides/img/bulb.png

4.72 KiB

2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_1.png

267 KiB

2022/2022-05-31_git-trilogy-part-1/slides/img/commit_GUI_web-ide.png

396 KiB

2022/2022-05-31_git-trilogy-part-1/slides/img/commit_changes.png

58.8 KiB