Skip to content
Snippets Groups Projects
Commit 9fb8f5ec authored by Sylvain Arreckx's avatar Sylvain Arreckx
Browse files

Merge branch 'laurent' into 'develop'

new images and content for branches slide

See merge request !11
parents 1f753fd8 45eb2a4e
No related branches found
No related tags found
No related merge requests found
Showing
with 71 additions and 27 deletions
......@@ -21,7 +21,7 @@
margin: 10px 0px;
background: rgba(255, 255, 255, 0.12);
border: 0px solid #000;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
box-shadow: 0 0 0px rgba(0, 0, 0, 0.15);
-webkit-transition: all .2s linear;
-moz-transition: all .2s linear;
-ms-transition: all .2s linear;
......
img/branch-0-master.png

96.8 KiB

img/branch-1-checkout-b.png

107 KiB

img/branch-2-commit.png

126 KiB

img/branch-3-merge.png

123 KiB

img/branch-4-br-d.png

114 KiB

img/branch-commit.png

79.5 KiB

img/branch-create.png

82.9 KiB

No preview for this file type
img/branch-master.png

65.4 KiB

img/branch-merge.png

66.8 KiB

File deleted
img/history_tracking.png

21.8 KiB

File deleted
img/history_tracking_collaboration.png

30.3 KiB

img/manual_version_control.png

80.3 KiB

......@@ -3,7 +3,7 @@
Branch-off within the same repository in order to stay safe!
The master branch:
<img src="img/branch-0-master.png" class="as-is" />
<img src="img/branch-master.png" class="branch-master" />
## One branch per feature
......@@ -14,7 +14,7 @@ $ git checkout -b matrix_vect_mult_myName
```
The `-b` flag creates the branch.
<img src="img/branch-1-checkout-b.png" class="as-is" />
<img src="img/branch-create.png" class="branch-create" />
## Switch between branches
......@@ -40,22 +40,23 @@ You can switch back to master with
$ git checkout master
```
<div class="fragment">
<br>
You can use the 5 essential commands as before.
Only difference: you are on your own branch.
<img src="img/branch-commit.png" class="branch-commit" />
## Merge a branch
If you want your feature on the `develop` or `master` branches, merge!
<br>
**submit a MR or a PR** via the Github/Gitlab interface.
<img src="img/branch-merge.png" class="branch-merge" />
<div class="fragment">
<br>
**ADVANCED**: You can see the differences between branches
```sh
$ git diff master..matrix_vect_mult_myName
......
......@@ -95,7 +95,7 @@ $ git pull
```
## Push your file to the folder
## Push your file to the repository
```sh
$ git push
......
## Fork
## Forks
<img src="img/remote-0-master.png" class="as-is" />
You **fork** when you want to work on a public repository or a protected repository.
<img src="img/remote-1-remote.png" class="as-is" />
Remember:
## Ajouter une _remote_
- A **fork** is your own **copy** of a repository.
- A **fork** can have multiple **branches**
- A **fork** is not a **branch**, but can have multiple **branches**.
```shell
$ git remote add origin git@github.com:<user>/<proj>.git
$ git remote -v
## Fork on GitLab
## Fork on GitHub
## Clone your fork
Clone first:
```sh
$ git clone https://git-r3lab.uni.lu/myGroup/myRepo.git forkMyRepo
```
<br>
then, you can change to the directory:
```sh
$ cd forkMyRepo
```
```shell
$ git push origin master
## Add the address of the original repository
Add the `upstream` (where you copied from)
```sh
$ git remote add upstream https://git-r3lab.uni.lu/origGroup/origRepo.git
```
<img src="img/remote-2-push.png" class="as-is" />
<br>
You can then check whether the remote address is set correctly:
```sh
$ git remote -v
```
<!-- <img src="img/remote-0-master.png" class="as-is" /> //-->
<!-- <img src="img/remote-1-remote.png" class="as-is" /> //-->
<!--- <img src="img/remote-2-push.png" class="as-is" /> //-->
## Récupérer les changements
```shell
$ git checkout master # Aller sur la branche master
$ git status # Est-ce propre? (Bien sûr!)
$ git pull origin master # Récupérer le travail
# de l'équipe
## Synchronize your fork
```sh
$ git checkout master
$ git status
```
<div class="fragment">
<br>
Fetch the changes from upstream (similar to pull)
```sh
$ git fetch upstream
```
## _Sync Branch_
Terminologie de l'application GitHub
<div class="fragment">
<br>
Merge the retrieved changes
```sh
$ git merge upstream/master
```
<div class="fragment">
<br>
Push the changes to your own fork:
```sh
$ git push origin master
```
## Pull/Merge Requests
......
......@@ -44,7 +44,7 @@ $ git config --global user.email "first.last@uni.lu"
## Does it work?
```shell
```sh
$ git --version
# git version 2.10.0
```
......@@ -77,7 +77,7 @@ Any other rudimentary method such as
shall **be avoided**!
## How do I `clone` any other repository?
## How do I `clone` a repository?
You can clone any other repository with:
```sh
......
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