forks.md 1.82 KB
Newer Older
Sylvain Arreckx's avatar
Sylvain Arreckx committed
1

2
## What is a `fork`?
Sylvain Arreckx's avatar
Sylvain Arreckx committed
3

4
5
6
<div class="fragment">
<img src="img/fork.jpg" class="as-is" />
[//]: <> (http://www.cndajin.com/data/wls/246/22302193.jpg)
Laurent Heirendt's avatar
Laurent Heirendt committed
7

8

9
10
## Not really ...
<img src="img/fork-crossed.png" class="as-is" />
11
12


13
14
## What is a `fork`?
In general, when contributing to a repository, you only have **read** access.
15

16
17
<div class="fragment">
In other words, you can only **pull** (unless it is your own repository or access has been granted).
18

19
20
21
<div class="fragment">
<br>
In general, you **cannot write** changes. In other words, you do not have **push** access.
22

23
24
<div class="fragment">
You have to work on your **own copy**.
Sylvain Arreckx's avatar
Sylvain Arreckx committed
25

26
<div class="fragment">
27
<br>
28
In other words, you have to work on your own <font color="red">**fork**</font>.
Sylvain Arreckx's avatar
Sylvain Arreckx committed
29

30

31
## How to get a fork?
32

33
Browse to the original repository and click on the button `Fork`:
Sylvain Arreckx's avatar
Sylvain Arreckx committed
34

35
![Fork the repo](https://help.github.com/assets/images/help/repository/fork_button.jpg)
Sylvain Arreckx's avatar
Sylvain Arreckx committed
36

Laurent Heirendt's avatar
Laurent Heirendt committed
37
38
<div class="fragment">
<img src="img/icon-live-demo.png" height="100px">
Sylvain Arreckx's avatar
Sylvain Arreckx committed
39

40

41
42
## Time to practice!

43
<br>
44
45

Fork the practice repository: <br><br>
Laurent Heirendt's avatar
Laurent Heirendt committed
46
https://git-r3lab.uni.lu/R3school/git.practice
47
48

Then, clone your fork to your home directory!
Sylvain Arreckx's avatar
Sylvain Arreckx committed
49

Laurent Heirendt's avatar
Laurent Heirendt committed
50
51
52
53
<div class="fragment">
<br>
<img src="img/icon-live-demo.png" height="100px">

54
55
<div class="fragment">
<br>
Sylvain Arreckx's avatar
Sylvain Arreckx committed
56
```bash
57
58
$ git clone ssh://git@git-r3lab-server.uni.lu:8022/yourUserName/
  git.practice.git practice
59
60
```

Laurent Heirendt's avatar
Laurent Heirendt committed
61
62
63
64
65
66
67
<br>
Change to the practice directory with:
```bash
$ cd practice
```


68
69
70
71
72
73
74
75
76
77
78
79
80
<font color="red">
Any other rudimentary method such as

*'I simply download the `.zip` and unzip it - works like a charm!'*

shall **be avoided**!
</font>

<div class="fragment">
<br>Why?


## How to update my fork?
Sylvain Arreckx's avatar
Sylvain Arreckx committed
81

82
As you have your own fork, it will not automatically update once the original repository is update.
Sylvain Arreckx's avatar
Sylvain Arreckx committed
83

84
![bulb](img/bulb.png) You have to update it yourself!
Sylvain Arreckx's avatar
Sylvain Arreckx committed
85

86
87
88
<div class="fragment">
<br>
**More on that later!**
Laurent Heirendt's avatar
Laurent Heirendt committed
89