forks.md 1.78 KB
Newer Older
1
2
# What is a `fork`?

Laurent Heirendt's avatar
Laurent Heirendt committed
3
<br><br>
Laurent Heirendt's avatar
Laurent Heirendt committed
4
<center><img src="slides/img/fork.jpg" class="as-is" height="500em"/></center>
5
6
7
8
9
10
<!--http://www.cndajin.com/data/wls/246/22302193.jpg-->



# Not really ...

Laurent Heirendt's avatar
Laurent Heirendt committed
11
<br><br>
Laurent Heirendt's avatar
Laurent Heirendt committed
12
<center><img src="slides/img/fork-crossed.png" class="as-is" height="500em"/></center>
13
14
15
16
17



# What is a `fork`?

Laurent Heirendt's avatar
Laurent Heirendt committed
18
- In general, when contributing to a repository, you only have **read** access.
19

Laurent Heirendt's avatar
Laurent Heirendt committed
20
- In other words, you can only **pull** (unless it is your own repository or access has been granted).
21

Laurent Heirendt's avatar
Laurent Heirendt committed
22
- In general, you **cannot write** changes. In other words, you do not have **push** access.
23

Laurent Heirendt's avatar
Laurent Heirendt committed
24
- You have to work on your **own copy**.
25

Laurent Heirendt's avatar
Laurent Heirendt committed
26
- In other words, you have to work on your own <font color="red">**fork**</font>.
27

Laurent Heirendt's avatar
Laurent Heirendt committed
28
<br>
Laurent Heirendt's avatar
Laurent Heirendt committed
29
<h2>How to get a fork?</h1>
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

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)




# Time to practice!

Fork the practice repository: <br><br>
https://github.com/LCSB-BioCore/basic-git-practice

Then, clone your fork to your home directory!

```bash
$ git clone git@github.com:<yourName>/basic-git-practice.git
```

Change to the practice directory with:
```bash
$ cd basic-git-practice
```

Laurent Heirendt's avatar
Laurent Heirendt committed
54
55
56
57
<img src="slides/img/icon-live-demo.png" height="100px">

If you did not configure your SSH key, clone using HTTPS:
```bash
Laurent Heirendt's avatar
Laurent Heirendt committed
58
$ git clone https://github.com/<yourName>/basic-git-practice.git
Laurent Heirendt's avatar
Laurent Heirendt committed
59
60
```

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78


# A note on shortcuts ...

<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>

**Why?**



# How to update my fork?

Laurent Heirendt's avatar
Laurent Heirendt committed
79
As you have your own fork, it will not automatically be updated once the original repository is updated.
80
81
82
83
84

![bulb](slides/img/bulb.png) You have to update it yourself!

**More on that later!**