Skip to content

Commit d85817c

Browse files
authored
Merge pull request #48 from codeharborhub/dev-1
Docs: GitHub Docs added
2 parents c3cae43 + e0af3b9 commit d85817c

31 files changed

+952
-3
lines changed

docs/github/_category_.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "GitHub",
3+
"position": 4,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "Learn React.js for building user interfaces, and learn how to use React.js with other technologies like Redux, Webpack, and ES6."
7+
}
8+
}

docs/github/clone-a-repository.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
id: clone-a-repository
3+
title: Clone a Repository
4+
sidebar_label: Clone a Repository
5+
sidebar_position: 4
6+
description: Learn how to clone a repository from GitHub to your local machine using Git. Clone a project, work on it locally, and push your changes back to GitHub.
7+
tags: [github, git, version control, collaboration, beginners]
8+
keywords: [github, git, version control, collaboration, beginners, open source, repository, clone, project]
9+
---
10+
11+
**To work on a project from GitHub, you need to clone the repository to your local machine. This allows you to make changes to the project, work on new features, and contribute to the codebase.**
12+
13+
<AdsComponent />
14+
15+
<br />
16+
17+
18+
To clone a repository from GitHub, follow these steps:
19+
20+
1. Go to [GitHub](https://github.com/) and log in to your account. After logging in, you will see your GitHub dashboard.
21+
22+
<BrowserWindow url="https://github.com/chh-user" bodyStyle={{ padding: 0 }}>
23+
![GitHub Login](img-12.png)
24+
</BrowserWindow>
25+
26+
2. Navigate to the repository you want to clone. You can find repositories on your dashboard, in your profile, or by searching for a specific repository.
27+
28+
<BrowserWindow url="https://github.com/chh-user?tab=repositories" bodyStyle={{ padding: 0 }}>
29+
![Repository List](img-13.png)
30+
</BrowserWindow>
31+
32+
3. Click on the repository you want to clone to open its main page. On the main page, you will see the repository details, code, issues, and other information. For example, let's clone the "hello-world" repository.
33+
34+
<BrowserWindow url="https://github.com/chh-user/hello-world" bodyStyle={{ padding: 0 }}>
35+
![Repository Main Page](img-14.png)
36+
</BrowserWindow>
37+
38+
4. Click on the "Code" button to open the code download options. You can clone the repository using HTTPS, SSH, or GitHub CLI. For this tutorial, we will use HTTPS.
39+
40+
<BrowserWindow url="https://github.com/chh-user/hello-world" bodyStyle={{ padding: 0 }}>
41+
![Code Download Options](img-15.png)
42+
</BrowserWindow>
43+
44+
5. Copy the HTTPS URL of the repository. You will use this URL to clone the repository to your local machine.
45+
46+
<BrowserWindow url="https://github.com/chh-user/hello-world" bodyStyle={{ padding: 0 }}>
47+
![HTTPS URL](img-16.png)
48+
</BrowserWindow>
49+
50+
<AdsComponent />
51+
52+
<br />
53+
54+
6. Open your terminal or command prompt on your local machine. Navigate to the directory where you want to clone the repository. Use the `cd` command to change directories.
55+
56+
```bash title="Terminal"
57+
cd path/to/directory
58+
```
59+
60+
7. Clone the repository using the `git clone` command followed by the HTTPS URL you copied earlier. This command will download the repository to your local machine.
61+
62+
:::tip Note:
63+
Replace `chh-user` with the **username** of the repository owner and `hello-world` with the name of the repository you want to clone.
64+
:::
65+
66+
```bash title="Terminal"
67+
git clone https://github.com/chh-user/hello-world.git
68+
```
69+
70+
![alt text](img-17.png)
71+
72+
73+
8. After cloning the repository, you can navigate to the project directory using the `cd` command.
74+
75+
```bash title="Terminal"
76+
cd hello-world
77+
```
78+
79+
9. You have successfully cloned the repository to your local machine. You can now work on the project, make changes to the code, and push your changes back to GitHub.
80+
81+
```pwsh
82+
# Make changes to the code
83+
# Add new features
84+
# Fix bugs
85+
# Push changes back to GitHub
86+
```
87+
88+
Congratulations! You have successfully cloned a repository from GitHub to your local machine. You can now start working on the project, collaborate with others, and contribute to the codebase. Happy coding!

docs/github/commit-changes.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
id: commit-changes
3+
title: Commit Changes
4+
sidebar_label: Commit Changes
5+
sidebar_position: 7
6+
description: Learn how to commit changes to a Git repository using Git. Commit your changes, add a commit message, and keep track of your project history with Git commits.
7+
tags: [github, git, version control, collaboration, beginners]
8+
keywords: [github, git, version control, collaboration, beginners, open source, commit, changes, history, project]
9+
---
10+
11+
**To save your changes to a Git repository, you need to commit them. Committing changes creates a snapshot of your project at a specific point in time, allowing you to track the history of your project and collaborate with others.**
12+
13+
<AdsComponent />
14+
15+
<br />
16+
17+
To commit changes to a Git repository, follow these steps:
18+
19+
1. Open your terminal or command prompt on your local machine. Navigate to the directory of your Git repository using the `cd` command.
20+
21+
```bash title="Terminal"
22+
cd path/to/repository
23+
```
24+
25+
2. Check the status of your repository to see which files have changed. Use the `git status` command to view the changes that are not yet staged for commit.
26+
27+
```bash title="Terminal"
28+
git status
29+
```
30+
31+
The `git status` command will show you the files that have been modified, added, or deleted since the last commit.
32+
33+
3. Stage the changes you want to commit using the `git add` command. This command adds the changes to the staging area, preparing them for the next commit.
34+
35+
```bash title="Terminal"
36+
git add filename
37+
```
38+
39+
:::tip Note:
40+
Replace `filename` with the name of the file you want to stage. You can also use `git add .` to stage all changes in the repository.
41+
:::
42+
43+
4. Commit the changes using the `git commit` command. This command creates a new commit with the changes you staged in the previous step.
44+
45+
```bash title="Terminal"
46+
git commit -m "Add new feature to the project"
47+
```
48+
49+
:::tip Note:
50+
Replace `"Add new feature to the project"` with a meaningful commit message that describes the changes you made in this commit.
51+
:::
52+
53+
<AdsComponent />
54+
55+
<br />
56+
57+
5. Verify the commit by checking the commit history of your repository. Use the `git log` command to view the commit history, including the commit message, author, date, and commit hash.
58+
59+
```bash title="Terminal"
60+
git log
61+
```
62+
63+
The `git log` command will display a list of commits in reverse chronological order, showing the most recent commits first.
64+
65+
6. Congratulations! You have successfully committed changes to your Git repository. Your project history is now updated with the new commit, and you can continue working on your project with confidence.

docs/github/create-a-branch.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
id: create-a-branch
3+
title: Create a Branch
4+
sidebar_label: Create a Branch
5+
sidebar_position: 5
6+
description: Learn how to create a new branch in a Git repository. Create a branch to work on new features, bug fixes, or experiments without affecting the main codebase.
7+
tags: [github, git, version control, collaboration, beginners]
8+
keywords: [github, git, version control, collaboration, beginners, open source, branch, create, new, feature, bug fix]
9+
---
10+
11+
**To work on new features, bug fixes, or experiments in a Git repository, you need to create a new branch. Branches allow you to work on different parts of the codebase without affecting the main branch.**
12+
13+
<AdsComponent />
14+
15+
<br />
16+
17+
:::caution Prerequisites
18+
- Make sure you have installed Git on your local machine and configured it with your GitHub account before creating a new branch. If you haven't done this yet, follow the **[official Git installation guide](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)**.
19+
- Always create a new branch for each new feature, bug fix, or experiment to keep your codebase clean and organized.
20+
- Make sure you have downloaded the VS Code editor from the official website before following this tutorial. If you haven't done this yet, you can download it from **[https://code.visualstudio.com/](https://code.visualstudio.com/)**.
21+
- VS Code is a popular code editor that provides built-in Git support, making it easy to work with Git repositories directly from the editor.
22+
:::
23+
24+
To create a new branch in a Git repository, follow these steps:
25+
26+
1. Open VS Code and open the project you want to create a branch in.
27+
28+
2. Open the terminal in vs code.
29+
30+
3. Run the following command to create a new branch. Replace `branch-name` with the name of your new branch.
31+
32+
```bash title="Terminal"
33+
git checkout -b branch-name
34+
```
35+
36+
:::tip Note:
37+
The `-b` flag is used to create a new branch. If you want to switch to an existing branch, you can omit the `-b` flag.
38+
:::
39+
40+
4. Your new branch is now created. You can start working on new features, bug fixes, or experiments in this branch without affecting the main codebase.
41+
42+
5. To switch between branches, use the `git checkout` command followed by the branch name.
43+
44+
```bash title="Terminal"
45+
git checkout main
46+
```
47+
48+
This command will switch to the `main` branch. Replace `main` with the name of the branch you want to switch to.
49+
50+
6. To list all branches in the repository, use the `git branch` command.
51+
52+
```bash title="Terminal"
53+
git branch
54+
```
55+
56+
This command will list all branches in the repository and highlight the current branch with an asterisk (`*`).
57+
58+
<AdsComponent />
59+
60+
<br />
61+
62+
7. To delete a branch, use the `git branch -d` command followed by the branch name.
63+
64+
```bash title="Terminal"
65+
git branch -d branch-name
66+
```
67+
68+
This command will delete the specified branch. Be careful when deleting branches, as this action cannot be undone.
69+
70+
8. To push a new branch to GitHub, use the `git push` command followed by the branch name.
71+
72+
```bash title="Terminal"
73+
git push origin branch-name
74+
```
75+
76+
This command will push the new branch to GitHub, allowing you to collaborate with others and share your work.
77+
78+
Congratulations! You have successfully created a new branch in your Git repository. You can now work on new features, bug fixes, or experiments in this branch without affecting the main codebase.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
id: create-a-github-account
3+
title: Create a GitHub account
4+
sidebar_label: Create a GitHub account
5+
sidebar_position: 2
6+
description: Learn how to create a GitHub account in a few simple steps. Get started with GitHub and start collaborating with others, contributing to open-source projects, and building your portfolio.
7+
tags: [github, git, version control, collaboration, beginners]
8+
keywords: [github, git, version control, collaboration, beginners, open source, repository, account, sign up]
9+
---
10+
11+
**To get started with GitHub, you need to create a GitHub account. If you already have a GitHub account, you can skip this step.**
12+
13+
<AdsComponent />
14+
15+
<br />
16+
17+
1. Go to [GitHub](https://github.com/) and click on the "Sign up" button.
18+
19+
<BrowserWindow url="https://github.com" bodyStyle={{ padding: 0 }}>
20+
![GitHub Sign Up](img-1.png)
21+
</BrowserWindow>
22+
23+
2. Enter your email address, choose a username, and create a password.
24+
25+
<BrowserWindow url="https://github.com" bodyStyle={{ padding: 0 }}>
26+
![Create Account](img-2.png)
27+
</BrowserWindow>
28+
29+
3. Click on the "Create account" button.
30+
4. Verify your email address.
31+
32+
You will receive an email from GitHub with a link to verify your email address. Click on the link to verify your email address.
33+
34+
<BrowserWindow url="https://mail.google.com/mail/u/..." bodyStyle={{ padding: 0 }}>
35+
![Verify Email](img-3.png)
36+
</BrowserWindow>
37+
38+
5. Congratulations! You now have a GitHub account.
39+
40+
<BrowserWindow url="https://github.com/chh-user" bodyStyle={{ padding: 0 }}>
41+
![GitHub account](img-4.png)
42+
</BrowserWindow>
43+
44+
Now that you have created a GitHub account, you can start using GitHub to collaborate with others, contribute to open-source projects, and build your portfolio.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
id: create-a-new-repository
3+
title: Create a New Repository
4+
sidebar_label: Create a New Repository
5+
sidebar_position: 3
6+
description: Learn how to create a new repository on GitHub in a few simple steps. Start a new project, share your code with others, and collaborate with your team using GitHub repositories.
7+
tags: [github, git, version control, collaboration, beginners]
8+
keywords: [github, git, version control, collaboration, beginners, open source, repository, create, new, project]
9+
---
10+
11+
**To get started with GitHub, you need to create a new repository. If you already have a repository, you can skip this step.**
12+
13+
<AdsComponent />
14+
15+
<br />
16+
17+
## Create a New Repository
18+
19+
To create a new repository on GitHub, follow these steps:
20+
21+
1. Go to [GitHub](http://github.com/) and log in to your account.
22+
23+
<BrowserWindow url="https://github.com" bodyStyle={{ padding: 0 }}>
24+
![GitHub Login](img-1.png)
25+
</BrowserWindow>
26+
27+
2. Click on the "+" icon in the top right corner of the page and select "New repository" from the dropdown menu.
28+
29+
<BrowserWindow url="https://github.com" bodyStyle={{ padding: 0 }}>
30+
![New Repository](img-5.png)
31+
</BrowserWindow>
32+
33+
3. Enter a name for your repository in the "Repository name" field. (For example, "hello-world")
34+
35+
<BrowserWindow url="https://github.com/new" bodyStyle={{ padding: 0 }}>
36+
![Repository Name](img-6.png)
37+
</BrowserWindow>
38+
39+
4. Optionally, you can add a description for your repository in the "Description" field.
40+
41+
<BrowserWindow url="https://github.com/new" bodyStyle={{ padding: 0 }}>
42+
![Repository Description](img-7.png)
43+
</BrowserWindow>
44+
45+
<AdsComponent />
46+
47+
<br />
48+
49+
5. Choose the visibility of your repository. You can make it public or private.
50+
51+
<BrowserWindow url="https://github.com/new" bodyStyle={{ padding: 0 }}>
52+
![Repository Visibility](img-8.png)
53+
</BrowserWindow>
54+
55+
6. Select the "Initialize this repository with a README" checkbox if you want to create a README file for your repository.
56+
57+
<BrowserWindow url="https://github.com/new" bodyStyle={{ padding: 0 }}>
58+
![Initialize Repository](img-9.png)
59+
</BrowserWindow>
60+
61+
7. Click on the "Create repository" button to create your new repository.
62+
63+
<BrowserWindow url="https://github.com/new" bodyStyle={{ padding: 0 }}>
64+
![Create Repository](img-10.png)
65+
</BrowserWindow>
66+
67+
8. Your new repository is now created. You can start adding files, folders, and code to your repository.
68+
69+
<BrowserWindow url="https://github.com/chh-user/hello-world" bodyStyle={{ padding: 0 }}>
70+
![Repository Created](img-11.png)
71+
</BrowserWindow>
72+
73+
Congratulations! You have successfully created a new repository on GitHub. You can now start working on your project, share your code with others, and collaborate with your team using GitHub repositories.

0 commit comments

Comments
 (0)