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
+37-25Lines changed: 37 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,29 @@
1
1
---
2
2
layout: page
3
-
title: Introduction to Version Control and git
3
+
title: Version Control and Git
4
4
---
5
5
6
-
## What is Version Control?
6
+
## Introduction to Version Control and Git
7
+
8
+
###Objectives
9
+
10
+
In this tutorial we are going to look what:
11
+
12
+
* What is Version Control?
13
+
* Why you need it?
14
+
* Setting up a repository
15
+
* Commiting to a repository
16
+
17
+
###Goal
7
18
8
-
Version control is a way that you can manage and track any changes you make to your files.
19
+
Today we will set up an account on Github (if you do not have one yet) and set up a new project and commit a file to that project.
9
20
21
+
## What is Version Control?
22
+
23
+
Version control is a way of recording all changes to a file or set of files over a period of time.
10
24
11
-
### Google docs revision history
12
-
Google docs, for example, keeps a revision history of any document you create and modify.
25
+
### Google Docs revision history
26
+
Google Docs, for example, keeps a revision history of any document you create and modify.
13
27
14
28
Have a look [at this Google document](https://docs.google.com/document/d/10kHJKXHLa-V8G6vVQoDiS6cTPvJoXnj_-SDvfQdziFk/edit?usp=sharing).
15
29
@@ -31,32 +45,31 @@ Wikipedia also holds a history of all changes.
31
45

32
46
33
47
- Try and have a look at the first revision of the page, by going back. It's dated back to 2005!
48
+
34
49
- Click **curr**, that will show you the [differences between the first and the latest entry](http://en.wikipedia.org/w/index.php?title=Women_in_computing&diff=583521812&oldid=19298328)
35
50
36
51

37
52
38
53
## Why do you need Version Control?
39
54
40
-
- 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.
55
+
- When used on a regular basis, version control helps you to store your files safely. It makes it easy to figure out what has broken your code as you can roll back to previous versions and work out when things last worked as expected.
41
56
42
-
- It is also helpful when working with other people as it combines all the changes together, and tracks who, why and when it changed.
57
+
- It is also helpful when working with other people as it combines all the changes, and tracks who made the change, when it changed and what files changed.
43
58
44
59
## Code version control systems
45
60
46
-
There are a number of different version control systems. The most popular ones are **svn** (or Subversion), **cvs**, **mercurial** and **git**.
61
+
There are a number of different version control systems. The most popular ones are **SVN** (or Subversion), **CVS**, **Mercurial** and **Git**.
47
62
48
-
We will be using **git**.
63
+
We will be using **Git**.
49
64
50
65
### Why Git?
51
-
There are a number of reasons we chose git. To name some
66
+
There are a number of reasons why we will be using Git. To name a few:
52
67
53
-
-A lot of learning resources
68
+
-There are a lot of learning resources online
54
69
55
-
-Does not require you to be connected to the internet to use
70
+
-It allows more than one person to safely work on the same project without interfering with each other
56
71
57
-
- All your tracked changes stay on your machine until you are happy with them, and want to make them part of your codebase
58
-
59
-
- Will tell you if someone has made changes since you last pushed code and urge you to update first and resolve issues
72
+
- It will tell you if someone has made changes since you last pushed code and urge you to update first then resolve any possible issues
60
73
61
74
- 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
62
75
@@ -83,20 +96,19 @@ Some popular project using git:
83
96
- commit: Applying any changes you have made to the **repository**
84
97
85
98
#### Aim for small and focused changes
86
-
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.
99
+
When using version control, you should commit every time you do a small piece of work, rather than working for hours on many different amends.
87
100
88
-
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.
101
+
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 of all paragraphs. You should do three commits, using messages that describe what you have done each time.
89
102
90
103
###Bad commit messages
91
104
92
105
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_
93
106
94
-
Try using messages like _repositioned image to look better on page_, _resolved positioning issue for Firefox_.
95
-
107
+
Try using messages like _repositioned image to look better on page_ or _resolved positioning issue for Firefox_.
96
108
97
109
# The next step!
98
110
99
-
Sign up to[github](http://github.com/)
111
+
Create an account on[github](http://github.com/)
100
112
101
113
Download [Github for Windows](http://windows.github.com/) or [Github for Mac](http://mac.github.com/)
102
114
@@ -108,16 +120,16 @@ Now that you have the Github client setup on your machine, we will spend sometim
108
120
109
121

110
122
111
-
2. Create a README.md file in the directory you created the repository and write
123
+
2. Create a README.md file in the directory of the repository and write
112
124
113
-
_This is where I store the work I have done at Codebar_
125
+
_This is where I store the work I have done at codebar_
114
126
115
127
3. Go to the Github client and commit that file
116
128

117
129
118
130
4. Now, create a new branch called **gh-pages**
119
131
120
-
5. In the directory, create a subdirectory **lesson1** and move the **html** file you created at the first sessionand all the other relevant files and directories (e.g. /images)
132
+
5. In the directory, create a subdirectory **lesson1** and move the **html** file you created in the first session and all the other relevant files and directories (e.g. /images)
121
133
122
134
6. Now, link the file from the root of your project by creating an `index.html` and adding a link to the page
123
135
@@ -136,11 +148,11 @@ Now that you have the Github client setup on your machine, we will spend sometim
136
148
137
149
To access your work, go to `http://<username>.github.io/codebar`
138
150
139
-
10. Repeat the process to list the rest of the tutorials you have worked on on the page as well.
151
+
10. Repeat the process to list the rest of the tutorials you have worked on too.
140
152
141
153
## Bonus
142
154
This is your personal page. Use what we learned in the previous lessons to style it, and make it look pretty, and what we learned today to commit and publish your changes.
143
155
144
156
-----
145
157
146
-
This ends our _Introduction to Version Control and git_ lesson. Is there something you don't understand? Try and go through the provided resources with your coach. If you have any feedback, or can think of ways to improve this tutorial [send us an email](mailto:feedback@codebar.io) and let us know.
158
+
This ends our _Introduction to Version Control and Git_ lesson. Is there something you don't understand? Try and go through the provided resources with your coach. If you have any feedback, or can think of ways to improve this tutorial [send us an email](mailto:feedback@codebar.io) and let us know.
0 commit comments