Skip to content

Commit 13cf4ea

Browse files
committed
Splitting out Git usage from basic info
1 parent 1795f01 commit 13cf4ea

File tree

2 files changed

+63
-30
lines changed

2 files changed

+63
-30
lines changed

version-control/introduction/tutorial.md

Lines changed: 55 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -46,61 +46,91 @@ Wikipedia also holds a history of all changes.
4646

4747
## Code version control systems
4848

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

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**:
5352

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

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

58-
- A lot of learning resources are publicly available
58+
### Why Git and Github?
5959

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

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
6367

6468
- Will tell you if someone has made changes since you last pushed code and urge you to update first and resolve issues
6569

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
6787

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

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

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
7793

78-
## Terminology
94+
- **Pull**: Get the latest version of code from a reposity
7995

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
8197

82-
- **Repository**: A repository is where code is stored
98+
- **Add**: Adds your chosen changes to the local Stage area, ready for a commit
8399

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
85101

86-
- **Commit**: Applying any changes you have made to the **repository**
102+
- **Status**: Shows the state of the working directory and the Staging area
87103

88-
#### Aim for small and focused changes
104+
- **Commit**: Applying any changes you have made into the repository
89105

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

92114
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.
93115

94116
### Write meaningful commit messages
95117

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_.
97119

98120
Try using messages such as _repositioned image to look better on page_ or _resolved positioning issue for Firefox_.
99121

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
101128

102129
Get set-up with [Git and GitHub](../set-up/tutorial.html).
103130

131+
132+
---------- REMOVE FROM HERE ONWARDS -----------
133+
104134
## Now what?
105135

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

version-control/set-up/tutorial.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@ title: Set-up Git and GitHub
55

66
## Introduction to Git and GitHub
77
-----
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.
109

1110
## Before you begin
1211
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.
1312

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`.
1516

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
1719

18-
### Setup your Git details
20+
commits
21+
To associate commits you make to repositories to yourself, we need to set-up a Username
1922

2023
```bash
2124
$ git config --global user.name "Your Name"

0 commit comments

Comments
 (0)