Skip to content

Commit a9a3538

Browse files
committed
added docs for github actions doc
1 parent afd5efa commit a9a3538

File tree

9 files changed

+432
-3
lines changed

9 files changed

+432
-3
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"label": "Git & GitHub",
3+
"position": 5,
4+
"link": {
5+
"type": "generated-index",
6+
"title": "Git & GitHub For Absolute Beginners",
7+
"description": "The foundation of every developer's career. Learn to track changes, collaborate with teams, and contribute to open-source at CodeHarborHub. Master Git and GitHub to navigate the world of software development with confidence. Whether you're a beginner or looking to deepen your understanding, our comprehensive resources will guide you through the essentials of version control, branching strategies, and collaborative workflows. Start your journey to becoming a proficient developer today!"
8+
},
9+
"customProps": {
10+
"icon": "🐙",
11+
"status": "Foundational"
12+
}
13+
}

absolute-beginners/git-github-beginner/basic-git-usage/index.mdx

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"label": "Basic Git",
3+
"position": 4,
4+
"link": {
5+
"type": "generated-index",
6+
"title": "Basic Git Commands for Absolute Beginners",
7+
"description": "Learn the essential commands you will use 90% of the time as a developer. From creating your first repository to pushing code to GitHub. Master the basics of Git to track changes, collaborate with others, and manage your code effectively. Whether you're new to version control or looking to solidify your understanding, this guide will walk you through the fundamental Git commands every developer should know. Start your journey to becoming a proficient developer today!"
8+
}
9+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: "Initializing a Repository (git init)"
3+
sidebar_label: "1. git init"
4+
sidebar_position: 1
5+
description: "Learn how to start version control in your project using the git init command. This guide will walk you through the process of creating a new Git repository, understanding what git init does, and best practices for beginners. Whether you're starting a new project or adding Git to an existing one, this tutorial will help you get set up and ready to track your code changes effectively."
6+
tags: ["git", "git init", "version control", "repository", "beginner guide"]
7+
keywords: ["git", "git init", "version control", "repository", "beginner guide"]
8+
---
9+
10+
Every great project at **CodeHarborHub** starts with a single step: telling Git to start watching your files. This process is called **Initialization**.
11+
12+
The `git init` command transforms an ordinary directory (folder) into a GitHub-ready **Git Repository**.
13+
14+
:::info
15+
Think of `git init` as the "Start Engine" button for your project. It revs up Git's engine and gets it ready to track every change you make to your code.
16+
:::
17+
18+
## What does `git init` actually do?
19+
20+
When you run this command, Git creates a hidden folder named `.git` inside your project. This folder is the "Brain" of your project—it stores every version, every branch, and every configuration for that specific repository.
21+
22+
### The "Before and After"
23+
* **Before `git init`:** Your folder is just a collection of files. If you delete a line of code, it’s gone forever.
24+
* **After `git init`:** Your folder is a **Repository**. Git is now "listening" for changes, ready to save snapshots of your work.
25+
26+
## How to Use It
27+
28+
Follow these steps to start your first repository:
29+
30+
1. **Open your Terminal** (or Git Bash on Windows).
31+
2. **Navigate** to your project folder:
32+
```bash
33+
cd Desktop/my-web-project
34+
```
35+
3. **Run the Initialization:**
36+
```bash
37+
git init
38+
```
39+
40+
**Expected Output:**
41+
42+
> `Initialized empty Git repository in C:/Users/Ajay/Desktop/my-web-project/.git/`
43+
44+
## The Repository Lifecycle
45+
46+
```mermaid
47+
graph TD
48+
A[Create Folder] --> B[git init]
49+
B --> C{Is it a Repo?}
50+
C -- Yes --> D[Hidden .git folder created]
51+
D --> E[Ready for 'git add']
52+
C -- No --> F[Standard Folder]
53+
```
54+
55+
## Common Use Cases
56+
57+
| Scenario | What to do? |
58+
| :--- | :--- |
59+
| **New Project** | Create a folder → `git init`. |
60+
| **Existing Code** | Go to the existing folder → `git init`. |
61+
| **Mistake?** | If you initialized the wrong folder, simply delete the hidden `.git` folder to stop tracking. |
62+
63+
## Important Rules for Beginners
64+
65+
1. **Don't Touch the `.git` Folder:** You will see this folder if you have "Hidden Items" turned on. **Never** delete or modify files inside it manually, or you might lose your entire project history!
66+
2. **Don't Nest Repositories:** Avoid running `git init` inside a folder that is *already* inside another Git repository. One project = One `.git` folder.
67+
3. **The "Main" Branch:** By default, Git creates a starting branch. In modern development, this is usually called `main` (though older versions might call it `master`). You can rename it later, but for now, just know that this is your "Main" branch where your stable code will live.
68+
69+
:::tip Did you know?
70+
You only need to run `git init` **once** per project. Once the `.git` folder exists, Git will continue to track that folder forever until you delete it.
71+
:::
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
title: "Installation and Initial Setup"
3+
sidebar_label: "3. Setup & Configuration"
4+
sidebar_position: 3
5+
description: "Step-by-step guide to installing Git on Windows, Mac, and Linux, and configuring your global developer identity. Learn how to verify your setup and connect Git to GitHub for seamless version control and collaboration."
6+
tags: ["git", "installation", "setup", "configuration", "version control"]
7+
keywords: ["git", "installation", "setup", "configuration", "version control"]
8+
---
9+
10+
Before you can start contributing to **CodeHarborHub** projects, you need to turn your computer into a "Git-aware" machine. Follow the guide below for your specific Operating System.
11+
12+
:::important
13+
Before we dive in, make sure you have a GitHub account set up. If you haven't done that, follow the instructions in **[Create a GitHub Account](/tutorial/github/create-a-github-account)** first, and then come back here to set up Git on your machine.
14+
:::
15+
16+
## Step 1: Installing Git
17+
18+
<Tabs>
19+
<TabItem value="windows" label="Windows" default>
20+
21+
1. **Download:** Visit [git-scm.com/download/win](https://git-scm.com/download/win) and the download will start automatically.
22+
2. **Run the Installer:** Open the `.exe` file.
23+
3. **The "CodeHarborHub" Recommended Settings:**
24+
* **Editor:** Choose "Visual Studio Code" as Git's default editor.
25+
* **Path:** Select "Git from the command line and also from 3rd-party software."
26+
* **Line Endings:** Select "Checkout Windows-style, commit Unix-style."
27+
4. **Finish:** Click Install.
28+
29+
</TabItem>
30+
<TabItem value="mac" label="macOS">
31+
32+
1. **Check if installed:** Open Terminal and type `git --version`. macOS often comes with a version of Git pre-installed.
33+
2. **Install via Homebrew (Recommended):**
34+
```bash
35+
brew install git
36+
```
37+
3. **Alternative:** Download the installer from [git-scm.com/download/mac](https://git-scm.com/download/mac).
38+
39+
</TabItem>
40+
<TabItem value="linux" label="Linux">
41+
42+
Use your distribution's package manager. For **Ubuntu/Debian** (the most common for CodeHarborHub learners):
43+
44+
```bash
45+
sudo apt update
46+
sudo apt install git-all -y
47+
```
48+
49+
For **Fedora**:
50+
51+
```bash
52+
sudo dnf install git
53+
```
54+
55+
</TabItem>
56+
</Tabs>
57+
58+
## Step 2: Configuring Your Identity
59+
60+
This is the most important step! Git needs to know who you are so it can attach your name to your "Commits" (Save Points).
61+
62+
:::important
63+
Use the **same email address** you used for your GitHub account. This ensures your contributions are linked to your profile!
64+
:::
65+
66+
Open your terminal (or Git Bash on Windows) and run these two commands:
67+
68+
```bash
69+
# Set your professional name
70+
git config --global user.name "ajay-dhangar"
71+
72+
# Set your GitHub email
73+
git config --global user.email "ajay...@gmail.com"
74+
```
75+
76+
:::note
77+
Replace `"ajay-dhangar"` and `"ajay...@gmail.com"` with your actual name and email. This information will be visible in your commit history and on GitHub.
78+
:::
79+
80+
## Step 3: Verifying the Setup
81+
82+
Let's make sure everything is working perfectly. Run the following command to see your configuration:
83+
84+
```bash
85+
git config --list
86+
```
87+
88+
**What you should see:**
89+
90+
Look for the `user.name` and `user.email` lines in the output. If they match what you typed, your "Developer Identity" is now live!
91+
92+
## How the Setup Connects
93+
94+
```mermaid
95+
graph LR
96+
A[Your PC] -- "Name & Email" --> B[Git Config File]
97+
B -- "Identifies" --> C[Your Commits]
98+
C -- "Pushed to" --> D[GitHub Profile]
99+
D -- "Lights up" --> E[Contribution Green Squares]
100+
```
101+
102+
## Extra Credit: Essential "Helper" Tools
103+
104+
While you can do everything in the terminal, these tools make the **CodeHarborHub** experience much smoother:
105+
106+
1. **Visual Studio Code (VS Code):** The \#1 editor for developers. It has Git built right in!
107+
2. **Git Lens (Extension):** An extension for VS Code that shows you exactly who wrote every line of code as you click on it.
108+
3. **GitHub Desktop:** A simple visual interface if you aren't comfortable with the terminal yet.
109+
110+
:::tip Did you know?
111+
If you are on Windows, always use **Git Bash** (which was installed with Git) instead of the standard Command Prompt. It gives you a Linux-like experience that matches all professional tutorials!
112+
:::
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
title: "What is Git and Why Use It?"
3+
sidebar_label: "2. What is Git?"
4+
sidebar_position: 2
5+
description: "Learn the fundamentals of Git, the world's most popular version control system, and why it is essential for modern developers."
6+
tags: ["git", "version control", "software development", "collaboration", "branches"]
7+
keywords: ["git", "version control", "software development", "collaboration", "branches"]
8+
---
9+
10+
At **CodeHarborHub**, we define **Git** as the "Time Machine" for your code.
11+
12+
Technically, Git is a **Distributed Version Control System (DVCS)**. It tracks every change you make to your files, allowing you to go back to a previous version if something breaks. Unlike a simple "Undo" button, Git keeps a permanent history of every line of code ever written in your project.
13+
14+
:::info Fun Fact
15+
The name "Git" was chosen by its creator, Linus Torvalds, as a self-deprecating joke. In British slang, "git" means a foolish or unpleasant person. Linus said, "I'm an egotistical bastard, and I name all my projects after myself. First 'Linux', now 'Git'." Despite the name, Git has become the most widely used version control system in the world.
16+
:::
17+
18+
## Why Should We Use Git?
19+
20+
If you are working on a solo project or a massive team at **CodeHarborHub**, Git provides three "Industrial-Level" pillars that make development possible:
21+
22+
### 1. The "Safety Net" (Version History)
23+
Imagine you are building a React app. You add a new feature, and suddenly the whole site crashes. Without Git, you might spend hours trying to remember what you changed.
24+
* **With Git:** You simply "Roll Back" to the last working version in one command.
25+
26+
### 2. Parallel Universes (Branching)
27+
Want to try a crazy new UI design without breaking the live website?
28+
* Git allows you to create a **Branch**. This is a separate workspace where you can experiment freely. Once the feature is perfect, you "Merge" it back into the main project.
29+
30+
### 3. Collaboration (Teamwork)
31+
How do 1,000 developers work on the same Linux Kernel or a MERN stack project simultaneously?
32+
* Git manages the "Conflicts." It knows if Developer A changed line 10 and Developer B changed line 50, and it combines them automatically. If both developers change the same line, Git will ask you to resolve the conflict manually.
33+
34+
## Git vs. Traditional Saving
35+
36+
| Traditional Saving (The "Bad" Way) | Git Saving (The "Pro" Way) |
37+
| :--- | :--- |
38+
| `final_v1.zip`, `final_v2.zip` | One folder, infinite history. |
39+
| Overwriting a friend's work. | Automatic merging of changes. |
40+
| Hard to see "who changed what." | Detailed logs for every single line. |
41+
| No way to "test" safely. | Branches for every new feature. |
42+
43+
## How Git Works: The 3 Stages
44+
45+
Git doesn't just save files immediately. It uses a professional 3-step process to ensure your "Snapshots" are clean and intentional.
46+
47+
1. **Working Directory:** Your actual folder where you are typing code.
48+
2. **Staging Area (Index):** A "Pre-save" area. You pick which files are ready to be snapshotted.
49+
3. **Repository (HEAD):** The permanent database where Git stores the versions.
50+
51+
```mermaid
52+
graph LR
53+
A[Working Directory] -- "git add" --> B[Staging Area]
54+
B -- "git commit" --> C[Local Repository]
55+
C -- "git push" --> D[Remote - GitHub]
56+
```
57+
58+
## Git vs. GitHub: Don't Get Confused!
59+
60+
At **CodeHarborHub**, we use both, but they are different tools:
61+
62+
* **Git:** The **Tool**. It's the software installed on your computer that manages the history.
63+
* **GitHub:** The **Host**. It's a website (the cloud) where you upload your Git repositories so others can see them and collaborate.
64+
65+
:::info Think of it like this
66+
Git is the camera that takes the photos (commits), and GitHub is the Instagram where you share them. You can use Git without GitHub, but you can't use GitHub without Git!
67+
:::
68+
69+
## Getting Started at CodeHarborHub
70+
71+
To see if Git is already on your system, open your terminal and type:
72+
73+
```bash
74+
git --version
75+
```
76+
77+
If you see a version number (e.g., `git version 2.34.1`), you are ready to move to the next step! If not, head over to **[Installation and Setup](./installation-and-setup)** to get Git on your machine.
78+
79+
:::info
80+
Git is "Distributed." This means every developer on your team has a **full copy** of the project history on their own hard drive. If the central server (GitHub) ever goes down, the project can be restored from any developer's laptop!
81+
:::

absolute-beginners/git-github-beginner/learn-basics/index.mdx

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: What is Version Control Systems?
3+
sidebar_label: "1. What is VCS?"
4+
sidebar_position: 1
5+
description: "Understand the Time Machine of software development—Version Control Systems (VCS). Learn how VCS helps developers track changes, collaborate, and manage code history effectively. Discover the difference between centralized and distributed systems, and why Git is the industry standard for version control."
6+
tags: ["version control", "git", "vcs", "software development", "collaboration"]
7+
keywords: ["version control", "git", "vcs", "software development", "collaboration"]
8+
---
9+
10+
Imagine you are writing a 50-page research paper. You save it as `paper.docx`. Then you make changes and save it as `paper_final.docx`. Then your teacher gives feedback, and you save it as `paper_final_v2_ACTUAL_FINAL.docx`.
11+
12+
Soon, your folder looks like a mess, and you can't remember what you changed in which version.
13+
14+
In the software world, we use **Version Control Systems (VCS)** to solve this forever. At **CodeHarborHub**, we call it the **Developer's Time Machine**.
15+
16+
:::info Fun Fact
17+
The first version control system was created in the 1970s, long before the internet as we know it today. It was called **SCCS (Source Code Control System)** and was used to manage changes to software code on mainframe computers.
18+
:::
19+
20+
## The Core Purpose
21+
22+
A VCS is a software tool that helps software teams manage changes to source code over time. It keeps track of every single modification to the code in a special kind of database. If a mistake is made, developers can turn back the clock and compare earlier versions of the code to help fix the mistake while minimizing disruption to all team members.
23+
24+
### Why do we use it?
25+
26+
* **History:** You can see exactly who changed what line of code and why.
27+
* **Undo Button:** If you introduce a bug, you can "roll back" to a version that worked in seconds.
28+
* **Collaboration:** Multiple developers can work on the same file at the same time without overwriting each other's work.
29+
30+
## Centralized vs. Distributed VCS
31+
32+
Not all Version Control Systems work the same way. In the industry, we have moved from "Centralized" to "Distributed" systems.
33+
34+
<Tabs>
35+
<TabItem value="cvcs" label="Centralized (The Old Way)" default>
36+
37+
There is one single server that contains all the versioned files. You "check out" a file, edit it, and send it back.
38+
* **Risk:** If the server goes down, nobody can work or save their history.
39+
* *Example:* SVN (Subversion).
40+
41+
</TabItem>
42+
<TabItem value="dvcs" label="Distributed (The Modern Way)">
43+
44+
Every developer has a **full copy** of the entire project history on their own computer.
45+
* **Benefit:** You can work offline. If the main server crashes, any developer's copy can be used to restore it.
46+
* *Example:* **Git** (What we use at CodeHarborHub).
47+
48+
</TabItem>
49+
</Tabs>
50+
51+
## The Git "Snapshots" Concept
52+
53+
Most systems think of changes as "List of file changes." **Git** (the most popular VCS) thinks of information more like a series of **Snapshots**.
54+
55+
Every time you "Commit" (save) your work, Git takes a picture of what all your files look like at that moment and stores a reference to that snapshot.
56+
57+
```mermaid
58+
graph LR
59+
A[Version 1] --> B[Version 2]
60+
B --> C[Version 3]
61+
C --> D[Version 4]
62+
63+
subgraph "Snapshots"
64+
A
65+
B
66+
C
67+
D
68+
end
69+
```
70+
71+
## Key Terms Every Beginner Must Know
72+
73+
| Term | Meaning in "Human" Language |
74+
| :--- | :--- |
75+
| **Repository (Repo)** | The project folder containing all your code and its history. |
76+
| **Commit** | A "Save Point" in your timeline with a descriptive message. |
77+
| **Branch** | A "Parallel Universe" where you can test new ideas safely. |
78+
| **Merge** | Combining two parallel universes into one. |
79+
| **Clone** | Downloading a project from the internet to your local PC. |
80+
81+
## Why CodeHarborHub Uses Git
82+
83+
We use Git because it is the **Industrial Standard**. Whether you want to work at Google, a small startup, or contribute to Open Source, Git is the language you will speak. It ensures that our community projects stay organized and that every contributor's work is protected.
84+
85+
:::tip Did you know?
86+
Git was created by **Linus Torvalds** in 2005—the same genius who created the **Linux Kernel**. He needed a better way to manage thousands of developers working on Linux, so he built Git in just a few weeks\!
87+
:::

0 commit comments

Comments
 (0)