/
03-advanced-version-control.ipynb
142 lines (142 loc) · 6.66 KB
/
03-advanced-version-control.ipynb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Advanced Version Control\n",
"-------------------------------------------------------------\n",
"\n",
"Git Repository for this Workshop: https://github.com/unmrds/cc-version-control\n",
"\n",
"... for this notebook: https://github.com/unmrds/cc-version-control/blob/master/03-advanced-version-control.ipynb\n",
"\n",
"Welcome and welcome back! Please note the notebooks for today's workshop have been added to the same repository as we used to present the introduction to Git and DVCS previously. Please feel free to refer to those materials for a refresher or background info. We may repeat some steps to get set up today, but generally we won't be going through those notebooks again. However, we are happy to answer any questions!\n",
"\n",
"The concepts covered in the previous workshop focused on a basic workflow:\n",
"\n",
"__Pull - - > Edit/Create/Delete -> Add -> Commit - - > Push__\n",
"\n",
"![The basic workflow upon which all others are built ...](./images/basic_cycle.png)\n",
"\n",
"Though in reality it's better to think about it as a sequence of changes, each of which is recorded in the history of the repository\n",
"\n",
"![A sequential process ...](./images/basic_sequence.png)\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"In practice, and especially among collaborators, the basic workflow is often insufficient for complex tasks. \n",
"\n",
"![A complex collaborative process ...](./images/complex_sequence.png)\n",
"\n",
"Today we will cover some additional concepts and commands of use in real life workflows:\n",
"\n",
"* __Branching__ (`git checkout` and `git branch`) - making a copy of the current repository state to work on (within the repository) in parallel with the ongoing changes that might take place in the source branch.\n",
"* __Merging__ (`git merge`) - integrating the changes made in a separate branch back into the source branch (typically after testing)\n",
"* __Conflict resolution__ ([GitHub process documentation](https://help.github.com/articles/resolving-a-merge-conflict-using-the-command-line/#platform-windows)) - the process of resolving identified conflicts between changes made in parallel branches during the process of merging.\n",
"\n",
"Also, sometimes you need to tune up the contents of your repository, or go back in time.\n",
"\n",
"* __Ignoring files and directories__ (`git ignore`) - defining parts of the repository that should not be maintained in the history of the repository content. For example, large data files that are stored elsewhere, products of processes that generate documents or compiled applications based on the content of the repository. \n",
"* __Rolling back commits__ (`git reset`) - bring the repository back to a previous commit state - preferably while maintaining the history of the repository throughout the entire process\n",
"\n",
"Finally, you may want to work on a copy of someone else's repository, either for your own purposes, or to contribute changes to the original project.\n",
"\n",
"* __Fork a Repository__ ([GitHub process documentation](https://help.github.com/articles/fork-a-repo/#platform-windows)) - Create a copy of a public repository owned by someone else into one that you have commit privileges for. \n",
"\n",
"* __Generate a *pull request*__ ([GitHub process documentation](https://help.github.com/articles/about-pull-requests/)) - Ask that changes you have made to your forked repository be integrated into the source repository from which the clone was created. \n",
"\n",
"In the intro session, we mentioned a handful of DVCS use cases. Before we get into the hands-on part of today's workshop, it may be interesting to look at some more of these use cases in practice and at scale."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Git in the wild\n",
"---------------------------------------------------------------\n",
"\n",
"### The Linux kernel\n",
"\n",
"This is something of a meta-example, since Linus Torvalds initially developed Git as a VCS for the Linux kernel. Some interesting history is available on the [Git Wikipedia page](https://en.wikipedia.org/wiki/Git). \n",
"\n",
"The kernel is complex:\n",
"\n",
"![A map of the Linux kernel](./images/Linux_kernel_map.png)\n",
"\n",
"Image by Conan at English Wikipedia, CC BY 3.0, https://commons.wikimedia.org/w/index.php?curid=6092674\n",
"\n",
"A look at [Kernel.org](https://git.kernel.org/) demonstrates a lot of the benefits of DVCS:\n",
"\n",
"* Many, distributed contributors\n",
"* Annotation, transparency, audit trails\n",
"* Change tracking\n",
"\n",
"### Development of Sensor Firmware\n",
"\n",
"From [*Avian's Blog*](https://www.tablix.org/~avian/blog/archives/code/index-page3.html)\n",
"\n",
"![A visualization of the VENSA firmware repository history](https://www.tablix.org/~avian/blog/images2/2014/06/vesna_drivers_repository_branching_visualization.png)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Branching Models\n",
"\n",
"Many different strategies have been developed for using branching to manage concurrent and parallel development efforts. *GitFlow* is one popular model adopted by development teams to coordinate their work.\n",
"\n",
"### \"A Successful Git Branching Model\" - *GitFlow* - *by [Vincent Driessen](https://nvie.com/about/)*\n",
"\n",
"![Summary Figure](https://nvie.com/img/git-model@2x.png)\n",
"\n",
"[https://nvie.com/posts/a-successful-git-branching-model/](https://nvie.com/posts/a-successful-git-branching-model/)\n",
"\n",
"[https://datasift.github.io/gitflow/IntroducingGitFlow.html](https://datasift.github.io/gitflow/IntroducingGitFlow.html)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Time for Practice\n",
"\n",
"[04-git-tutorial-deux](./04-git-tutorial-deux.ipynb)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}