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
+55-25Lines changed: 55 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,61 +46,91 @@ Wikipedia also holds a history of all changes.
46
46
47
47
## Code version control systems
48
48
49
-
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**. Some are paid for and others are free.
50
50
51
-
We will be using **Git**.
52
-
Git is a tool that makes sharing code and collaborating with other developers really easy. It also keeps our code tracked and safe.
51
+
We will be using **Git** with **Github**:
53
52
54
-
### Why Git?
53
+
-**Git** is a tool that makes sharing code and collaborating with other developers easy. It also keeps our code tracked and safe.
54
+
-**Github** is the web based hosting service for our code repositories that we interact with through the Github web pages.
55
55
56
-
There are a number of reasons we chose Git, namely;
56
+
We'll use Git installed on our system to manage code we work on and then push our code to Github hosted repositories.
57
57
58
-
- A lot of learning resources are publicly available
58
+
### Why Git and Github?
59
59
60
-
- Does not require you to be connected to the internet to use
60
+
There are a number of reasons we chose Git and Github, namely;
61
61
62
-
- All your tracked changes stay on your machine until you are happy with them, and want to make them part of your codebase
62
+
- Lots of learning resources are publicly available
63
+
64
+
- Git does not require you to be connected to the internet to use
65
+
66
+
- All your tracked changes stay on your machine until you are happy with them, and want to make them part of your codebase on Github
63
67
64
68
- Will tell you if someone has made changes since you last pushed code and urge you to update first and resolve issues
65
69
66
-
- 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
70
+
- Github makes online collaboration easy. 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
71
+
72
+
### Projects on Github
73
+
Once you've worked through the Git and Github tutorials here at Codebase, there are an incredible amount of projects that you'll be able to access for free. These range from operating systems, games, programming languages, books and more.
74
+
75
+
- Go retro with a **Windows 95** simulation: [https://github.com/felixrieseberg/windows95](https://github.com/felixrieseberg/windows95)
76
+
77
+
- Learn more with free **Programming Books**: [https://github.com/EbookFoundation/free-programming-books](https://github.com/EbookFoundation/free-programming-books)
78
+
79
+
- Grab some free **Games** kept on Github: [https://github.com/leereilly/games](https://github.com/leereilly/games)
80
+
81
+
- Amazing **Android Apps** and learning resources: [https://github.com/Mybridge/amazing-android-apps](https://github.com/Mybridge/amazing-android-apps)
82
+
83
+
- Ideas for **cool projects** you can build or contribute to [https://github.com/open-source-ideas/open-source-ideas](https://github.com/open-source-ideas/open-source-ideas)
84
+
85
+
86
+
## Key Terms and Definitions for Git
67
87
68
-
Some popular projects using Git:
88
+
As with any technology and related tool, there's a lot of terminology realted to Git and Github. Here's some of the most common terms and their definitions:
69
89
70
-
- Android
71
-
- Linux
72
-
- Python
73
-
- Ruby
74
-
- PHP
90
+
-**Repository**: A repository is where code is stored, it can be a local or remote repository. Also called a 'repo'
75
91
76
-
# A bit more about Git
92
+
-**Clone**: Copy a repository so you can pull it down to your local machine and start editing the code
77
93
78
-
## Terminology
94
+
-**Pull**: Get the latest version of code from a reposity
79
95
80
-
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:
96
+
-**Push**: Send your code changes to the repository
81
97
82
-
-**Repository**: A repository is where code is stored
98
+
-**Add**: Adds your chosen changes to the local Stage area, ready for a commit
83
99
84
-
-**Checkout**: When you retrieve code from a **repository**, to your local machine
100
+
-**Stage**: An index of changes you are preparing to commit to the repository
85
101
86
-
-**Commit**: Applying any changes you have made to the **repository**
102
+
-**Status**: Shows the state of the working directory and the Staging area
87
103
88
-
#### Aim for small and focused changes
104
+
-**Commit**: Applying any changes you have made into the repository
89
105
90
-
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.
106
+
107
+
108
+
## Good Practices when Working with Git
109
+
110
+
### Aim for small and focused changes
111
+
112
+
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. What's more, it makes it harder to review changes you made and need merging into the current code base.
91
113
92
114
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.
93
115
94
116
### Write meaningful commit messages
95
117
96
-
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_
118
+
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_.
97
119
98
120
Try using messages such as _repositioned image to look better on page_ or _resolved positioning issue for Firefox_.
99
121
100
-
# The next step!
122
+
### Always check for updates by others
123
+
When you come back to coding, be sure to `pull` any changes into your local repository that others may have committed to the repository since you last worked on the code. If there are changes you don't pull in you can get **Merge Conflicts**, where two sets of changes, the ones from other people and yours, need to be worked through to decide which change is kept. Resolving merge conflicts is notoriously tricky - small, frequent commits followed by a pull are a great way to avoid merge conflicts.
124
+
125
+
126
+
127
+
## The next step
101
128
102
129
Get set-up with [Git and GitHub](../set-up/tutorial.html).
103
130
131
+
132
+
---------- REMOVE FROM HERE ONWARDS -----------
133
+
104
134
## Now what?
105
135
106
136
Now that you have the Github client setup on your machine, we will spend some time adding what you have created in the HTML and CSS lessons to an internet repository! Before you start make sure the Github client is running and you are signed in.
Copy file name to clipboardExpand all lines: version-control/set-up/tutorial.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,20 @@ title: Set-up Git and GitHub
5
5
6
6
## Introduction to Git and GitHub
7
7
-----
8
-
In this tutorial we'll look at
9
-
8
+
Now that we know what Version Control is, let's get set-up with Git on our system and make sure we're ready to start creating our own projects and contributing to others.
10
9
11
10
## Before you begin
12
11
Install command line Git for your operating system ([OS X](https://sourceforge.net/projects/git-osx-installer/), [Windows](http://msysgit.github.io/) or [Linux](https://git-scm.com/download/linux)) and open your terminal / command prompt.
13
12
14
-
Download [Github Desktop](https://desktop.github.com/) (for Mac or Windows).
13
+
Download [Github Desktop](https://desktop.github.com/) for Mac or Windows.
14
+
15
+
Now create a directory where you will be storing all your projects. You can call it something obvious such as `code` or `projects`.
15
16
16
-
Create a directory where you will be storing all your projects. You can call it `code` or `projects`.
17
+
### Set-up your Account Git details
18
+
When we make a commit to a respository we need to associate it with ourselves. To do that we can tell Git our Github account username and email address
17
19
18
-
### Setup your Git details
20
+
commits
21
+
To associate commits you make to repositories to yourself, we need to set-up a Username
0 commit comments