Skip to content

Commit b16980e

Browse files
committed
Merge pull request #188 from RabeaGleissner/intro-to-git-command-line-updates
fixed typos and grammar, made some sentences easier to understand
2 parents 79572c8 + 0b097b9 commit b16980e

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

version-control/command-line/tutorial.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
---
22
layout: page
3-
title: Introduction to the git command line
3+
title: Introduction to the Git command line
44
---
55

66
## Introduction to the Git command line
77

88
**PREREQUISITE:** Basic understanding of the command line.
99

10-
Git is an easy to share and collaborate tool that keeps our code tracked and safe.
11-
With the following examples we understand how to deal with the daily usage of the tool.
10+
Git is a tool that makes sharing code and collaborating with other developers really easy. It also keeps our code tracked and safe. The following examples will help you understand how to use this tool on a daily basis.
1211

1312
## Before you begin
14-
Install command line git for your operating system ([OS X](http://code.google.com/p/git-osx-installer), [Windows](http://msysgit.github.com/) or [Linux](http://git-scm.com/download/linux)) and open your terminal / command prompt.
13+
Install command line Git for your operating system ([OS X](http://sourceforge.net/projects/git-osx-installer/), [Windows](http://msysgit.github.com/) or [Linux](http://git-scm.com/download/linux)) and open your terminal / command prompt.
1514

1615
Create a directory where you will be storing all your projects. You can call it `code` or `projects`.
1716

18-
### Setup your git details
17+
### Setup your Git details
1918

2019
```bash
2120
$ git config --global user.name "Your Name"
@@ -24,13 +23,14 @@ $ git config --global user.email "name@domain"
2423

2524
### Setup an SSH key
2625

27-
You need an ssh key so you don't have to authenticate every time you want to commit to git.
26+
An SSH key is used to identify trusted computers, without entering a password.
27+
[Instructions on how to generate an SSH key](https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key)
2828

2929

3030
## Example 1: Everyday commands
3131

3232

33-
### Create and add your project in git
33+
### Create and add your project in Git
3434

3535
```bash
3636
$ mkdir practising-git
@@ -44,15 +44,15 @@ $ git init
4444
$ echo "<h1>Learning git</h1>" > index.html
4545
```
4646

47-
> The above command will output `<h1>Learning git</h1>` and store it in `index.html`. Open up the file and have a look.
47+
> The above command will output `<h1>Learning Git</h1>` and store it in `index.html`. Open up the file and have a look.
4848
49-
### Check the git repository status.
49+
### Check the Git repository status.
5050

5151
```bash
5252
$ git status
5353
```
5454

55-
> The above command will tell you what files in the current directory have been changed, what files have not yet been added to the git repository and so on.
55+
> The above command will tell you which files in the current directory have been changed, which files have not yet been added to the Git repository and so on.
5656
5757
### Add your file on the repository and commit your changes.
5858

@@ -64,7 +64,7 @@ $ git commit -m 'this is my first command-line commit!'
6464

6565
> `.` will add all the files in the current directory and subdirectories. You should only use it when initialising your repository. Rest of the time you can specify the file names to be added.
6666
67-
### Check the git commit history.
67+
### Check the Git commit history.
6868

6969
```bash
7070
$ git log
@@ -127,9 +127,9 @@ Update the `index.html` file and then commit and push the changes
127127
<body>
128128
<h1> Learning Git </h1>
129129
<dl>
130-
<dt>Initialise a git repository</dt>
130+
<dt>Initialise a Git repository</dt>
131131
<dd>git init</dd>
132-
<dt>Add files to git</dt>
132+
<dt>Add files to Git</dt>
133133
<dd>git add filename</dd>
134134
</dl>
135135
</body>
@@ -152,7 +152,7 @@ $ git commit -m 'updated to include the commands I learned today'
152152
$ git push origin master
153153
```
154154

155-
### Check the repository git history
155+
### Check the repository Git history
156156

157157
```bash
158158
$ git log
@@ -175,9 +175,9 @@ Update `index.html`
175175
<body>
176176
<h1> Learning Git </h1>
177177
<dl>
178-
<dt>Initialise a git repository</dt>
178+
<dt>Initialise a Git repository</dt>
179179
<dd>git init</dd>
180-
<dt>Add files to git</dt>
180+
<dt>Add files to Git</dt>
181181
<dd>git add <filename></dd>
182182
<dt>Checking file changes</dt>
183183
<dd>git status</dd>
@@ -196,7 +196,7 @@ $ git diff
196196
The -/+ indications you can see mean
197197

198198
**-** indicates lines removed from the code.
199-
199+
200200
**+** indicates lines added to the code.
201201

202202
```bash
@@ -244,7 +244,7 @@ Changes not staged for commit:
244244
(use "git add <file>..." to update what will be committed)
245245
(use "git checkout -- <file>..." to discard changes in working directory)
246246

247-
modified: index.html
247+
modified: index.html
248248

249249
no changes added to commit (use "git add" and/or "git commit -a")
250250
```
@@ -382,10 +382,10 @@ git push origin master
382382

383383
# Extras
384384

385-
Following are some good resources to to help you set up git.
385+
Following are some good resources to to help you set up Git.
386386
https://help.github.com/articles/set-up-git
387387

388-
## Configuring your git environment
388+
## Configuring your Git environment
389389

390390
Create the file `.gitconfig` in your root directory and add the following configuration
391391

@@ -405,7 +405,7 @@ Create the file `.gitconfig` in your root directory and add the following config
405405

406406
> Can you think of another command that you would find handy to shorten down?
407407
408-
### Telling git to try and fix whispace issues before committing
408+
### Telling Git to try and fix whitespace issues before committing
409409

410410
```
411411
[apply]
@@ -419,7 +419,7 @@ Create the file `.gitconfig` in your root directory and add the following config
419419
excludesfile = ~/.gitignore
420420
```
421421

422-
To apply this you need to create a .gitignore file in your root path. There you can add either specific files or extentions that you always want excluded. This is a handy list to help you start
422+
To apply this you need to create a .gitignore file in your root path. There you can add either specific files or extensions that you always want excluded. This is a handy list to help you start
423423

424424
```
425425
*.DS_Store
@@ -433,9 +433,9 @@ To apply this you need to create a .gitignore file in your root path. There you
433433
> Do you know what these files are? You normally wouldn't want to commit logs or packages.
434434
435435

436-
### Pimping your log historyr
436+
### Pimping your log history
437437

438-
In your aliases add this as an alias for viewing git logs
438+
In your aliases add this as an alias for viewing Git logs
439439
```
440440
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
441441
```

0 commit comments

Comments
 (0)