Skip to content

Commit f4896db

Browse files
Merge pull request #436 from MarkCBJSS/gh-pages
Updates and addition to Version Control tutorials
2 parents 87262d5 + 51199d2 commit f4896db

21 files changed

+328
-138
lines changed

index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ <h2>Command Line</h2>
113113
<h2>Version Control</h2>
114114
<ul>
115115
<li><a href="version-control/introduction/tutorial.html">Introduction to version control</a></li>
116-
<li><a href="version-control/command-line/tutorial.html">Introduction to the git command line</a></li>
116+
<li><a href="version-control/set-up/tutorial.html">Get set-up with Git and GitHub</a></li>
117+
<li><a href="version-control/command-line/tutorial.html">Introduction to the Git command line</a></li>
117118
</ul>
118119

119120
<h2>Other Useful Resources</h2>

version-control/command-line/tutorial.md

Lines changed: 109 additions & 63 deletions
Large diffs are not rendered by default.
1.69 KB
Loading
8.62 KB
Loading
-174 KB
Loading
-26 KB
Loading
Lines changed: 52 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
---
22
layout: page
3-
title: Introduction to version control and git
3+
title: Introduction to Version Control and Git
44
---
55

66
## What is version control?
77

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

10-
### Google docs revision history
10+
### Google Docs revision history
1111

12-
Google docs, for example, keeps a revision history of any document you create and modify.
12+
Google Docs, for example, keeps a revision history of any document you create and modify.
1313

1414
Have a look [at this Google document](https://docs.google.com/document/d/10kHJKXHLa-V8G6vVQoDiS6cTPvJoXnj_-SDvfQdziFk/edit?usp=sharing).
1515

1616
- Select to see the revision history (you must be logged in with your Google account to do that!)
1717

18-
![](images/see_revision_history.png)
18+
![See Revision History](images/see_revision_history.png)
1919

2020
- And the more detailed version
2121

22-
![](images/more_detailed.png)
22+
![More Detailed Revision History](images/more_detailed.png)
2323

2424
Scroll through the revisions, from the bottom up. You should be able to see each set of changes highlighted in green.
2525

@@ -29,130 +29,108 @@ Wikipedia also holds a history of all changes.
2929
- Go to [this document](https://en.wikipedia.org/wiki/Women_in_computing)
3030
- Click **view history**
3131

32-
![](images/wikipedia-view-history.png)
32+
![Wikipedia View History](images/wikipedia-view-history.png)
3333

3434
- Try and have a look at the first revision of the page, by going back. It's dated back to 2005!
3535
- Click **curr**, that will show you the [differences between the first and the latest entry](https://en.wikipedia.org/w/index.php?title=Women_in_computing&diff=583521812&oldid=19298328)
3636

37-
![](images/wikipedia-diff.png)
37+
![Wikipedia Diff Example](images/wikipedia-diff.png)
3838

3939
## Why do you need Version Control?
4040

4141
- 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+
- With no version control in place you'll only have one copy of your file, then when it breaks there's likely no way to get back to working code!
4343

4444
- It is also helpful when working with other people as it combines all the changes together and tracks who, why and when it changed.
4545
- In the work environment this may be essential to know for example, what issue the change fixes or customer requirement it relates to.
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**.
51+
We will be using **Git** with **Github**:
5252

53-
### 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.
5455

55-
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.
5657

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

59-
- 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;
6061

61-
- 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
6263

63-
- Will tell you if someone has made changes since you last pushed code and urge you to update first and resolve issues
64-
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
66-
67-
Some popular projects using Git:
68-
69-
- Android
70-
71-
- Linux
72-
73-
- Python
74-
75-
- Ruby
76-
77-
- PHP
64+
- Git does not require you to be connected to the internet to use
7865

79-
# A bit more about Git
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
8067

81-
## Terminology
82-
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:
68+
- Will tell you if someone has made changes since you last pushed code and urge you to update first and resolve issues
8469

85-
- **Repository**: A repository is where code is stored
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
8671

87-
- **Checkout**: When you retrieve code from a **repository**, to you local machine
72+
### Projects on Github
73+
Once you've worked through the Git and Github tutorials here at codebar, there are an incredible range of projects that you'll be able to access for free. These projects include operating systems, games, programming languages, books and more.
8874

89-
- **Commit**: Applying any changes you have made to the **repository**
75+
- Go retro with a **Windows 95** simulation: [https://github.com/felixrieseberg/windows95](https://github.com/felixrieseberg/windows95)
9076

91-
#### Aim for small and focused changes
77+
- Learn more with free **Programming Books**: [https://github.com/EbookFoundation/free-programming-books](https://github.com/EbookFoundation/free-programming-books)
9278

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.
79+
- Grab some free **Games** kept on Github: [https://github.com/leereilly/games](https://github.com/leereilly/games)
9480

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.
81+
- Amazing **Android Apps** and learning resources: [https://github.com/Mybridge/amazing-android-apps](https://github.com/Mybridge/amazing-android-apps)
9682

97-
### Write meaningful commit messages
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)
9884

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_
85+
- Grab a copy of an extensive **Git Cheatsheet** for reference [https://github.com/arslanbilal/git-cheat-sheet](https://github.com/arslanbilal/git-cheat-sheet)
10086

101-
Try using messages such as _repositioned image to look better on page_ or _resolved positioning issue for Firefox_.
87+
To find more projects, just enter a search in Github and see what comes back!
10288

103-
# The next step!
10489

105-
Sign up to [Github](https://github.com/)
90+
## Key Terms and Definitions for Git
10691

107-
Download [Github Desktop](https://desktop.github.com/) (for Mac or Windows).
92+
As with any technology and related tool, there's a lot of terminology related to Git and Github. Here's some of the most common terms and their definitions:
10893

109-
## Now what?
94+
- **Repository**: A repository is where code is stored, it can be a local or remote repository. Also called a 'repo'
11095

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.
96+
- **Clone**: Copy a repository so you can pull it down to your local machine and start editing the code
11297

113-
1. Create a new repository by clicking the `Create New Repository` button
98+
- **Pull**: Get the latest version of code from a reposity
11499

115-
![](images/create-new-repository.png)
100+
- **Push**: Send your code changes to the remote repository
116101

117-
2. In your text editor, open the directory you just created and create a README.md file with the following content:
102+
- **Add**: Adds your chosen changes to the local Stage area, ready for a commit and push
118103

119-
_This is where I store the work I have done at codebar._
104+
- **Stage**: An index of changes you are preparing to commit to the repository
120105

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
122-
123-
![](images/add-readme.png)
106+
- **Status**: Shows the state of the working directory and the Staging area
124107

125-
4. Now, create a new branch called **gh-pages**
108+
- **Commit**: Applying any changes you have made into the repository
126109

127-
![](images/create-new-branch.png)
128110

129-
5. In the directory, create a subdirectory **lesson1** and move the **html** file you created at the first session and all the other relevant files and directories (e.g. /images)
130111

131-
6. Now, link the file from the root of your project by creating an `index.html` file and adding a link to the page
112+
## Good Practices when Working with Git
132113

133-
```
134-
<a href='lesson1/index.html'>Lesson 1 - Introduction to HTML </a>
135-
```
136-
> Don't forget to rename index to whatever you have named your file!
114+
### Aim for small and focused changes
137115

138-
7. Commit your changes to the gh-pages branch
116+
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 common 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.
139117

140-
![](images/commit-changes.png)
118+
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.
141119

142-
8. Once you committed your changes publish your work by clicking the `Publish repository` button
120+
### Write meaningful commit messages
143121

144-
![](images/publish-repository.png)
122+
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_.
145123

146-
9. View your work on the web!
124+
Try using messages such as _repositioned image to look better on page_ or _resolved positioning issue for Firefox_.
147125

148-
To access your work, go to `http://<username>.github.io/codebar`
126+
### Always check for updates by others
127+
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.
149128

150-
10. Repeat the process to list the rest of the tutorials you have worked on on the page as well.
151129

152-
## Bonus
130+
## The next step
153131

154-
This is your personal page. Use what you learned in the previous lessons to style it, make it look pretty, and what we learned today to commit and publish your changes.
132+
Get set-up with [Git and GitHub](../set-up/tutorial.html).
155133

156134
-----
157135

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:[email protected]) and let us know.
136+
This ends our **Introduction to version control with 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:[email protected]) and let us know.
Binary file not shown.
34.2 KB
Loading
38.5 KB
Loading

0 commit comments

Comments
 (0)