Skip to content

Commit 45c1d29

Browse files
committed
updating git 101
1 parent 49d84d7 commit 45c1d29

File tree

7 files changed

+2619
-1677
lines changed

7 files changed

+2619
-1677
lines changed

docusaurus.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ const config = {
3434
],
3535
],
3636

37+
themes: ["@docusaurus/theme-mermaid"],
38+
markdown: {
39+
mermaid: true,
40+
},
41+
3742
presets: [
3843
[
3944
"classic",

git_101/Grade 1/git_clone.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
id: Git Clone
3+
sidebar_position: 5
4+
---
5+
import Tabs from '@theme/Tabs';
6+
import TabItem from '@theme/TabItem';
7+
8+
Instead of starting a new project from scratch, you can use Git to clone an existing repository — copying all its files, branches, and history to your local machine.
9+
10+
This is one of the most common ways to start working on a project that’s hosted on GitHub or another remote platform.
11+
12+
## What does `Git clone` do
13+
14+
Actions of the git clone command are as follows:
15+
16+
* Creates a local copy of a remote repository.
17+
18+
* Automatically sets up the connection to the remote (`origin`).
19+
20+
* Downloads all branches and commit history.
21+
22+
**Example**
23+
24+
```bash
25+
git clone <repository-url>
26+
```
27+
28+
## Clone Your First Repository
29+
30+
1. Open a terminal or command prompt.
31+
32+
2. Navigate to the folder where you want to download the repo:
33+
```bash
34+
cd projects # or any other directory
35+
```
36+
3. Run the clone command:
37+
```bash
38+
git clone https://github.com/Tom-Fynes/git-101
39+
```
40+
41+
4. You should see output like:
42+
``` vbnet
43+
Cloning into 'git-101'...
44+
remote: Enumerating objects: ...
45+
remote: Counting objects: ...
46+
Receiving objects: ...
47+
Resolving deltas: ...
48+
```
49+
50+
5. Now check your files:
51+
* Change directory to newly cloned repo
52+
```bash
53+
cd git-101
54+
```
55+
56+
* List all files and folders in directoy
57+
58+
<Tabs>
59+
<TabItem value="Windows" label="windows" default>
60+
```bash
61+
dir
62+
```
63+
</TabItem>
64+
<TabItem value="MacOs" label="Mac">
65+
```bash
66+
ls
67+
```
68+
</TabItem>
69+
<TabItem value="Linux" label="linux">
70+
```bash
71+
ls
72+
```
73+
</TabItem>
74+
</Tabs>

git_101/Grade 1/git_init.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ Once initialized, Git will start tracking changes in that folder — but only fo
1414
## Create Your First Repository
1515

1616
1. Open your terminal
17-
2. Navigate to the `git-101` folder created at the start of this course
18-
* if you mised this step please see [here](/git_101/intro)
17+
2. Navigate to a directory where you will keep your repo's
18+
* IF you don't have one I like to use **projects**: `mkdir projects`
1919
```bash
20-
cd git-101
20+
cd projects
2121
```
22+
2223
3. Initialize the repository:
2324
```bash
24-
git init
25+
git init git-demo
2526
```
2627

2728
4. You should see:

git_101/Grade 2/git_workflow.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
id: Understanding the Git Workflow
3+
sidebar_position: 1
4+
---
5+
6+
7+
To use `Git` effectively, it’s important to understand the workflow which is broken into three parts:
8+
9+
* Working Directory
10+
11+
* Staging Area (Index)
12+
13+
* HEAD (Repository)
14+
15+
These components work together to track, orgernise, and save changes.
16+
17+
## Working Directory
18+
19+
This is the current state of your project, the files and folders you’re actively editing.
20+
21+
Anything you create, modify, or delete here is considered unstaged by `Git`.
22+
23+
## Staging Area
24+
25+
The Staging Area is like a clipboard or checklist of changes you want to include in your next commit, you add files from your working directory to the staging area by using the `git add` command.
26+
27+
28+
## HEAD (Repository)
29+
30+
The `HEAD`, is the permanent history of commits. Each commit is a snapshot of the files that were staged at the time. Files are added to this area by using the `git commit` command.
31+
32+
## Visualizing the Git Workflow
33+
34+
```mermaid
35+
flowchart LR
36+
A[Working Directory] -->|Git add| B[Staging Area]
37+
B -->|Git commit| C[HEAD - Repository]
38+
C -->|checkout| A
39+
```

git_101/intro.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,6 @@ If you like this course and want to support the project, you can do so here:
1111

1212
[![Support me on Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/tomfynes)
1313

14-
## 🛠️ Setup Instructions
15-
16-
**Create a working directory:**
17-
18-
```bash
19-
mkdir git-101
20-
```
21-
22-
23-
**Navigate to the Directory:**
24-
25-
```bash
26-
cd git-101
27-
```
2814

2915
## Grades
3016

@@ -45,11 +31,11 @@ cd git-101
4531

4632
* [**Git init**](/git_101/Grade%201/Git%20Init): Initializing a repository with `git init`.
4733

48-
* Git clone: Cloning an existing repository with `git clone`.
34+
* [**Git clone**](/git_101/Grade%201/Git%20Clone): Cloning an existing repository with `git clone`.
4935

5036
### Grade 2: Basic Git Workflow
5137

52-
* Understanding the Git Workflow: Working Directory, Staging Area, and Repository.
38+
* [**Understanding the Git Workflow**](/git_101/Grade%202/Understanding%20the%20Git%20Workflow): Working Directory, Staging Area, and Repository.
5339

5440
* Adding files to staging with `git add`.
5541

@@ -125,7 +111,7 @@ cd git-101
125111

126112
* Applying specific commits with `git cherry-pick`.
127113

128-
* Rewriting commit history with g`it rebase`.
114+
* Rewriting commit history with git rebase`.
129115

130116

131117
### Grade 7: Troubleshooting and Optimization

0 commit comments

Comments
 (0)