Skip to content
Snippets Groups Projects
Commit f194cee0 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

Merge branch '2022-05-31_TriologyOfGit-ContriguteUsingGitlab' into 'develop'

git part 1

See merge request !121
parents 3f29718d 5322034b
No related branches found
No related tags found
2 merge requests!129[release] Regular merge of develop,!121git part 1
Pipeline #57109 passed
Showing
with 289 additions and 0 deletions
# Wrap-up
* Git makes things separated but interlinked!
* separation of changes into commits - compare with standard "versioning" of dropbox/onedrive/owncloud or labeling v1.2 manually
* separation of work into branches - compare with standard work in parallel - making copy of file and renaming, then "putting it together"
* separation of work into forks - compare with "I will make my own copy of the whole folder"
<div class="fragment">
* GitLab creates a convenient working environment
* merge requests
* issues
* assignements
* and much much more...
<div style="position:absolute;left:55%;top:55%">
<img src="slides/img/fox.png">
https://pixabay.com/images/id-5236832/
</div>
</div>
# Wrap-up
## Glossary
* git
* repository
* fork
* commit
* branch
* merge
* merge/pull request
## 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.
* 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.
<div class="fragment">
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 changes
* your version won't be affected by others
* all related changes are aggregated on one place
* work can continue if the development of one feature gets stuck
Are you working on more features in parallel?
<font color="red">Create a new **branch**!</font> for each of them :)
# Time to practice!
1. What is the difference between **fork** and **branch**?
<div class="fragment fade-in-then-out">
<div style="position:absolute;left:10%;top:8em">
<img src="slides/img/forking_detail-with-branches.png" height="500em"/>
</div>
2. Why is best practice to branch off from `develop`?
3. Switch between branches
<div class="fragment fade-in-then-out">
<div style="position:absolute;left:10%;top:8em">
<img src="slides/img/branch_GUI_switch.png" height="500em"/>
</div>
# 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:
* message - why
* author - who
* timestamp - when
* unique identifier
<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 UI:
<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>
## Time to practice!
1. Notice last commit on files
<!-- .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" height="600px"/>
</div>
What is this
Notes:
Congrats! Now you have reviewed recent changes in your repository!
\ No newline at end of file
# 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>
<!--http://www.cndajin.com/data/wls/246/22302193.jpg-->
# 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.
- In general, by default you **cannot write** changes.
<div class="fragment">
<img src="slides/img/forking.png" height="400px">
- You have to work on your **own copy** of the repository
- In other words, you have to work on your own <font color="red">**fork**</font>.
<br>
## Why?
# How to get a fork?
Browse to the original repository and click on the button `Fork`:
<img src="https://docs.gitlab.com/ee/user/project/repository/img/forking_workflow_fork_button_v13_10.png" height="250px">
<br>
<img src="slides/img/icon-live-demo.png" height="100px">
## Time to practice!
1. Fork the practice repository: <br><br>
TODO<br><br>
Congrats! Now you have your own **fork**!
# How to update my fork? - TODO: move to the end or delete
\
As you have your own 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!**
# 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)
Another popular platforms:
- **GitHub**: [https://github.com](https://github.com)
- **BitBucket**: [https://bitbucket.org](https://bitbucket.org)
- **Gitea**: [https://gitea.io](https://gitea.io)
# Time to practice!
<img src="slides/img/icon-live-demo.png" height="100px">
1. Login to [https://gitlab.lcsb.uni.lu](https://gitlab.lcsb.uni.lu)
* use your LUMS credentials
2. browse the existing repositories
* Explore ->
* navigate to the training repository
3. Inspect project/repository folder structure
4. Discover an issue (see README.md) and report it
<div class="fragment">
Congrats! You are a **reporter** :)
</div>
notes:
- reporter is very important role
2022/2022-05-31_git-triology-part-1/slides/img/Git-logo.png

5.55 KiB

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

23.1 KiB

2022/2022-05-31_git-triology-part-1/slides/img/branch_branch-off_detail.png

40.4 KiB

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

16.1 KiB

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

16.6 KiB

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

18.2 KiB

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

4.72 KiB

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

267 KiB

2022/2022-05-31_git-triology-part-1/slides/img/commit_GUI_click-on-commit.png

62.4 KiB

2022/2022-05-31_git-triology-part-1/slides/img/commit_GUI_main-history.png

339 KiB

2022/2022-05-31_git-triology-part-1/slides/img/commit_GUI_main-last-commit.png

343 KiB

2022/2022-05-31_git-triology-part-1/slides/img/commit_GUI_main.png

330 KiB

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

339 KiB

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

114 KiB

2022/2022-05-31_git-triology-part-1/slides/img/commit_history-diagram-branch-only.png

25.2 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment