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

New content of slides (forks)

parent 5e06a51c
No related branches found
No related tags found
2 merge requests!18merge all,!11new images and content for branches slide
## 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