You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: version-control/introduction/tutorial.md
+26-22Lines changed: 26 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ title: Introduction to version control and git
5
5
6
6
## What is version control?
7
7
8
-
Version control is a way to manage and track any changes you make to your files.
8
+
Version control is a way to manage and track any changes you make to your files. If you've been using online services such as Google Docs or Wikipedia, then you'll already have been working with documents and pages that use a version control system.
9
9
10
10
### Google docs revision history
11
11
@@ -38,21 +38,23 @@ Wikipedia also holds a history of all changes.
38
38
39
39
## Why do you need Version Control?
40
40
41
-
- When used on a regular basis, version control helps you to store your files safely. It makes it easy to figure out what broke your code as you can roll back to a previous version and work out when things last worked as expected.
41
+
- When used on a regular basis, version control helps you to store your files safely. It makes it easy to figure out what broke your code, as you can roll back to a previous version and work out when things last worked as expected.
42
+
- With no version control in place you'll only have one copy of your file, then when it breaks there's no way to get back to good code!
42
43
43
-
- It is also helpful when working with other people as it combines all the changes together, and tracks who, why and when it changed.
44
+
- It is also helpful when working with other people as it combines all the changes together and tracks who, why and when it changed.
45
+
- In the work environment this may be essential to know for example, what issue the change fixes or customer requirement it relates to.
44
46
45
47
## Code version control systems
46
48
47
-
There are a number of different version control systems. The most popular ones are **svn** (or Subversion), **cvs**, **mercurial** and **git**.
49
+
There are a number of different version control systems. The most popular ones are **svn** (or Subversion), **cvs**, **Mercurial** and **Git**.
48
50
49
-
We will be using **git**.
51
+
We will be using **Git**.
50
52
51
53
### Why Git?
52
54
53
-
There are a number of reasons we chose git. To name some
55
+
There are a number of reasons we chose Git, namely;
54
56
55
-
- A lot of learning resources
57
+
- A lot of learning resources are publicly available
56
58
57
59
- Does not require you to be connected to the internet to use
58
60
@@ -62,7 +64,7 @@ There are a number of reasons we chose git. To name some
62
64
63
65
- Github and online collaboration. Open source code is a big part of today's life. By being able to retrieve and help existing projects, you can also contribute to them
64
66
65
-
Some popular project using git:
67
+
Some popular projects using Git:
66
68
67
69
- Android
68
70
@@ -78,23 +80,25 @@ Some popular project using git:
78
80
79
81
## Terminology
80
82
81
-
- repository: A repository is where code is stored
83
+
As with any technology and related tool, there's a lot of terminollgy used. Here's some of the most common terms and their definitions:
82
84
83
-
-checkout: When you retrieve code from a **repository**
85
+
-**Repository**: A repository is where code is stored
84
86
85
-
- commit: Applying any changes you have made to the **repository**
87
+
-**Checkout**: When you retrieve code from a **repository**, to you local machine
88
+
89
+
-**Commit**: Applying any changes you have made to the **repository**
86
90
87
91
#### Aim for small and focused changes
88
92
89
-
When using version control, you should commit every time you do a small piece of work, rather than working for hours in a row, changing too many things and then committing them.
93
+
When using version control, you should commit every time you do a small piece of work, rather than working for hours in a row, changing too many things and then committing them is a great way to introduce issues that are hard to track down.
90
94
91
-
For example, if you want to change the position of an element, the color of all the links on your page and the font size dimensions of all paragraphs, you should do three commits, using messages that describe what you are doing each time.
95
+
For example, if you want to change the position of an element, the colour of all the links on your page and the font size dimensions of all paragraphs, you should do three commits, using messages that describe what you are doing each time.
92
96
93
-
### Bad commit messages
97
+
### Write meaningful commit messages
94
98
95
-
Every time you commit a change use a message that describes your change clearly. In a few months time you will have difficulty remembering why you applied a change if your messages say _changing some CSS_, _another commit_, or _more changes_
99
+
Every time you commit a change use a message that describes your change clearly. In a few months time you will have difficulty remembering why you applied a change if your messages say _changing some CSS_, _another commit_ or _more changes_
96
100
97
-
Try using messages like _repositioned image to look better on page_,_resolved positioning issue for Firefox_.
101
+
Try using messages such as _repositioned image to look better on page_ or_resolved positioning issue for Firefox_.
98
102
99
103
# The next step!
100
104
@@ -104,17 +108,17 @@ Download [Github Desktop](https://desktop.github.com/) (for Mac or Windows).
104
108
105
109
## Now what?
106
110
107
-
Now that you have the Github client setup on your machine, we will spend some time adding what you have created in the HTML & CSS lessons on the internet! Before you start make sure the Github client is running and you are signed in.
111
+
Now that you have the Github client setup on your machine, we will spend some time adding what you have created in the HTML & CSS lessons to an internet repository! Before you start make sure the Github client is running and you are signed in.
108
112
109
-
1. Create a new repository by clicking the Create New Repository button
113
+
1. Create a new repository by clicking the `Create New Repository` button
110
114
111
115

112
116
113
-
2.Open the directory you just created in your text editor and create a README.md file with the following content:
117
+
2.In your text editor, open the directory you just created and create a README.md file with the following content:
114
118
115
119
_This is where I store the work I have done at codebar._
116
120
117
-
3. Go back to the Github client and commit the file by filling out the Summary field and hitting the Commit to master button
121
+
3. Go back to the Github client and commit the file by filling out the `Summary` field and hitting the `Commit to master` button
118
122
119
123

120
124
@@ -135,11 +139,11 @@ Now that you have the Github client setup on your machine, we will spend some ti
135
139
136
140

137
141
138
-
8. Once you committed your changes publish your work by clicking the **Publish repository** button
142
+
8. Once you committed your changes publish your work by clicking the `Publish repository` button
139
143
140
144

141
145
142
-
9. View your work on the internet!
146
+
9. View your work on the web!
143
147
144
148
To access your work, go to `http://<username>.github.io/codebar`
0 commit comments