# How to Start with Git and GitHub: A Beginner’s guide.

## Table of Contents
1.  What is Version Control System?    
2.  Why we use Version Control System?    
3.  Some examples of Version Control Systems    
4.  Why we use Git and GitHub?    
5.  Difference between Git and GitHub.    
6.  Where you can download Git?    
7.  How to install Git?    
8.  Setup Git on your system    
9.  Make an account on GitHub    
10.  How to connect Git and GitHub     
11.  Some basic commands of Git     
12.  How to write in Markdown (.md) file?    
13.  How to update GitHub profile?     
14.  How to make GitHub repository?     
15.  How to host HTML/CSS/JavaScript website on GitHub?     
16.  How to host Vite + React project on GitHub?     
17.  How to clean a repo from GitHub?     
18.  How to make a pull request on GitHub?     
19.  How to merge pull request on GitHub?     
20.  How to resolve merge conflicts?
     
* * *
### 1\. What is Version Control System?

Version Control System (VCS), also known as Source Code Management (SCM) or Revision Control System (RCS), is a software tool that helps track and manage changes in code over time.

It allows developers to:

*   Keep track of every change in the codebase    
*   Revert to previous versions if needed    
*   Work collaboratively with multiple developers    
*   Maintain a history of project development   

* * *

### 2\. Why we use Version Control System?

We use VCS because it helps in:

*   Collaboration between multiple developers 
*   Tracking code changes efficiently   
*   Backup of source code   
*   Easy rollback to previous versions   
*   Managing different versions of a project
    

* * *

### 3\. Some examples of Version Control Systems

*   Git
    
*   Subversion (SVN)
    
*   Mercurial
    
*   Perforce
    

* * *

### 4\. Why we use Git and GitHub?

### Git:

*   A distributed version control system
    
*   Works locally on your computer
    
*   Tracks changes in code
    

### GitHub:

*   A cloud platform for hosting Git repositories
    
*   Helps in collaboration
    
*   Provides backup and project management tools
    

* * *

### 5\. Difference between Git and GitHub

| Git | GitHub |
| --- | --- |
| Version control tool | Cloud hosting service |
| Works offline | Works online |
| Installed on system | Website platform |
| Tracks code changes | Stores Git repositories |

* * *

### 6\. Where you can download Git?

You can download Git from: https://git-scm.com/

* * *

### 7\. How to install Git?

1.  Download Git from official website
    
2.  Run installer
    
3.  Click Next → Next → Finish
    
4.  Verify installation using:
    

```bash
git --version
```


### 8. Setup Git on your System

After installing Git, configure your identity:

```bash
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
```
**To check configuration:**

```bash
git config --list
```


---

### 9. Make an Account on GitHub

1. Go to `https://github.com`


2. Click on Sign Up


3. Enter username, email, password


4. Verify your email


5. Your GitHub account is ready


---

### 10. How to connect Git and GitHub

Generate SSH key:

ssh-keygen -t rsa -b 4096 -C "your.email@example.com"

Add SSH key to GitHub:

Go to GitHub → Settings → SSH and GPG keys

Paste your public key


Test connection:

ssh -T git@github.com

---

### 11. Some basic Git commands

```bash
git init
git clone <repo-url>
git add .
git commit -m "your message"
git push origin main
git pull origin main
git status
git branch
git checkout -b new-branch
```

---

### 12. How to write in Markdown (.md) file?

Markdown is used to format text in GitHub.

Examples:
```md
# Heading 1
## Heading 2

- Item 1
- Item 2

**Bold Text**
*Italic Text*
```

---

### 13. How to update GitHub profile?

Go to your GitHub profile

Edit profile README repository

Update bio, links, and image

Commit changes to reflect updates


---

### 14. How to make GitHub repository?

1. Open GitHub


2. Click "New Repository"


3. Add repository name


4. Add description (optional)


5. Choose Public or Private


6. Click Create Repository


---

### 15. How to host HTML/CSS/JavaScript website on GitHub?

1. Push your project to GitHub


2. Go to repository settings


3. Open GitHub Pages section


4. Select branch (main)


5. Save settings


6. Your site will be live




---

### 16. How to host Vite + React project on GitHub?

Build your project first:

npm run build

Then:

Push the dist folder

Or configure vite.config.js:


base: "/repo-name/"

Enable GitHub Pages from settings.


---

### 17. How to clean a repo from GitHub?

To remove unwanted files:

```bash
git rm <file-name>
git commit -m "remove unwanted files"
git push
```
You can also delete branches from GitHub UI.


---

### 18. How to make a pull request on GitHub?

1. Fork the repository


2. Create a new branch


3. Make changes


4. Commit and push changes


5. Click "Compare & Pull Request"

---

### 19. How to merge pull request on GitHub?

1. Open Pull Requests tab
2. Select the PR
3. Review changes
4. Click "Merge Pull Request"
5. Confirm merge

---

### 20. How to resolve merge conflicts?

When conflict happens:

`git pull origin main`

Open conflicted file and fix:

```
<<<<<<< HEAD
your code
=======
incoming code
>>>>>>> branch
```

**Then:**

```bash
git add .
git commit -m "resolve merge conflict"
git push
```

