Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created Guide Pages in Docs #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions _posts/Guide/GitAndGithub/define.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"title": "Git and GitHub",
"position": 1
}
85 changes: 85 additions & 0 deletions _posts/Guide/GitAndGithub/github.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Position 2 might be clashing with already existing elements.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

title: "A guide to Github"
description: "getting started with github and creating new repository"
tags: ["github"]
date: 29 April 2023
position: 2
---

GitHub is a web-based platform for software developers to host, manage, and collaborate on their code.

## Some terms used to contribute open source
- Fork: A fork is a copy of a repository that you create on your own account. You can use a fork to make changes to the repository without affecting the original project.

- Clone: Cloning creates a local copy of a Git repository on your machine.

- Branch: A branch is a parallel version of a repository that allows you to make changes without affecting the main codebase. This is useful when working on new features or bug fixes.

- Pull request: A pull request is a request to merge changes from one branch to another. When you make changes to a forked repository, you can submit a pull request to the original project owner to incorporate your changes.

- Merge: Merging combines changes from one branch into another. When a pull request is accepted, the changes are merged into the main branch of the repository.

- Commit: A commit is a record of changes to a repository. Each commit has a unique identifier and includes information about the changes made.

- Issue: An issue is a problem, bug, or feature request that needs to be addressed in a repository. Issues can be opened by anyone and are tracked on the GitHub platform.

- Repository: A repository is a collection of files and code that are stored together in Git. It contains all the project files, including the code, README file, and other documentation, as well as the history of changes made to the code.

- Pull: Pulling retrieves the latest changes from a remote repository and updates your local repository with those changes.

# Creating a repository
## On GitHub
- Log in to your GitHub account
- Click on the "+" icon on the top-right side of the dashboard and select "New repository"
![NewRepo](/images/newrepo.png)
- Enter the repository name, description, and choose whether the repository should be public or private
- Select "Initialize this repository with a README" if you want GitHub to automatically create a README file for you
- Choose a license for your repository (optional)
- Click on "Create repository"

## Using Local Git
- Open a terminal/command prompt and navigate to the directory where you want to create your repository.
- Run the following command to initialize a new Git repository in the current directory:
```git
git init
```
- Create a new file in the repository directory and add some content to it.
- Add the file to the staging area using the following command:
```git
git add .
```
- Commit the changes using the following command:
```git
git commit -m "Initial commit"
```
- If you have already created GitHub Repository,
Link your local repository to the remote repository using the following command:
```git
git remote add origin <remote repository URL>
```
Replace `remote repository URL` with the URL of your remote repository.
- Push the changes from your local repository to the remote repository using the following command:
```git
git push -u origin master
```

# Cloning the GitHub Repository
- First, navigate to the GitHub repository you want to clone.

- Click on the green "Code" button located on the right side of the repository page.
![CloneRepo](/images/clonerepo.png)

- Next, click on the clipboard icon to copy the URL of the repository.

- Open your terminal or command prompt on your computer.

- Navigate to the directory where you want to clone the repository using the command cd [directory name].

- Once you’re in the right directory, use the git clone command followed by the URL you copied earlier. For example
```git
git clone https://github.com/[username]/[repository-name].git
```

- Press enter and wait for Git to clone the repository onto your computer.

# Fork a repository on GitHub
59 changes: 59 additions & 0 deletions _posts/Guide/GitAndGithub/starting-with-git.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: "Starting with git"
description: "getting started with git"
tags: ["git"]
date: 29 April 2023
position: 1
---

Git is a version control system (VCS) that allows developers to manage the changes made to their code over time.
VCSs are essential tools for software development, as they enable collaboration, versioning, and backup of code.

Traditional version control systems like CVS or Subversion were centralized, meaning that there was a central repository where all the code was stored.
Developers would check out a copy of the code from the repository, make changes, and then commit those changes back to the repository. While this approach worked well for small teams, it had limitations for larger projects or distributed teams, as it required constant network connectivity to access the central server.
Git, on the other hand, is a distributed version control system. This means that every developer has a full copy of the repository on their local machine. They can work on the code locally, make changes, and commit them without needing to connect to a central server. Once they're ready, they can push their changes to a remote repository where other team members can pull in the changes.

Git was created by Linus Torvalds in 2005 as a tool to manage the Linux kernel development. It quickly became popular due to its speed, flexibility, and powerful branching model. Today, Git is one of the most widely used version control systems in the world, powering millions of software development projects ranging from small personal projects to large-scale enterprise applications.

# Installing Git on your machine

## MacOS
Install [homebrew](https://brew.sh/) if you don't already have it, then:
```bash
brew install git
```

[Follow official guide for more details](https://git-scm.com/download/mac)

## Linux
### Debian
- Open the Terminal and enter the command to update the package list
```bash
sudo apt update
```
- Enter the command to install Git
```bash
sudo apt install git
```

### Fedora
Open the Terminal and enter the command
```bash
sudo dnf install Git
```

### Arch Linux
Open the Terminal and enter the command
```bash
sudo pacman -Syu git
```

## Windows
Sorry Guys, but intall Linux on your machine :)

# Configure Git
After installing Git, open the terminal/command prompt and configure your user name and email address using these commands:
```git
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
```
4 changes: 4 additions & 0 deletions _posts/Guide/define.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"title": "Guide",
"position": 9999
}
7 changes: 7 additions & 0 deletions _posts/Guide/markdown.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Markdown Guide"
description: "getting started with markdown and readme files"
tags: ["md"]
date: 29 April 2023
position: 3
---
Binary file added public/images/clonerepo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/newrepo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.