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

Merge branch '2020-01-31_gitTrainingBiotechTeam' into 'develop'

slides for git training - biotech team

See merge request !59
parents cb24c75e 2b3b7324
No related branches found
No related tags found
2 merge requests!60Regular merge of develop,!59slides for git training - biotech team
Pipeline #20342 passed
Showing
with 246 additions and 0 deletions
# 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!**
# 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">
![bulb](slides/img/bulb.png) 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"/>
# 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
# 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`:
![Fork the repo](https://help.github.com/assets/images/help/repository/fork_button.jpg)
# How to update my fork?
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!
<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
# 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
../../../../2019/2019-06-11_basicGitTraining/slides/img/branch-create.png
\ No newline at end of file
../../../../2019/2019-06-11_basicGitTraining/slides/img/branch-master.png
\ No newline at end of file
../../../../2019/2019-06-11_basicGitTraining/slides/img/branch-merge.png
\ No newline at end of file
../../../../2019/2019-06-11_basicGitTraining/slides/img/bulb.png
\ No newline at end of file
2020/2020-01-31_gitTrainingBioTech/slides/img/favicon.ico

39.9 KiB

../../../../2019/2019-06-11_basicGitTraining/slides/img/fork-crossed.png
\ No newline at end of file
../../../../2019/2019-06-11_basicGitTraining/slides/img/fork.jpg
\ No newline at end of file
../../../../2019/2019-06-11_basicGitTraining/slides/img/git_definition.png
\ No newline at end of file
../../../../2019/2019-06-11_basicGitTraining/slides/img/icon-live-demo.png
\ No newline at end of file
../../../../2019/2019-06-11_basicGitTraining/slides/img/linus.jpg
\ No newline at end of file
../../../../2019/2019-06-11_basicGitTraining/slides/img/logoLCSB.png
\ No newline at end of file
../../../../2019/2019-06-11_basicGitTraining/slides/img/r3-training-logo.png
\ No newline at end of file
# 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>
[
{ "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" }
]
# 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
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