# 🔥Day9#90daysDevops🚀  Challenge

### **Day 9 Task**: Deep Dive in Git & GitHub for DevOps Engineers.

1. What is Git and why is it important?
    
2. What is the difference Between the Main Branch and the Master Branch??
    
3. Can you explain the difference between Git and GitHub?
    
4. How do you create a new repository on GitHub?
    
5. What is the difference between local & remote repositories? How to connect local to remote?
    

---

### **1\. What is Git and why is it important?**

🔸 Git is the **Version Control System(VCS)** also known as a **Global Information Tracker** which allows your file to have version history.

🔸 Git is primarily used for **code management** which acts like a **version control system** and allows you to **collaborate.**

There are two main types of source code management

1. **Centralized Version Control System** (CVCS): This is not locally available, we always need to connect to the network to perform any activity.
    
2. **Distributed Version Control System** (DVSC): This is locally available so that everyone maintains the local repository.
    

---

### 2 . What is the difference Between the Main Branch and the Master Branch?

🔸 **"Master branch"** is the default branch in Git and **"Main branch"** is the default branch in GitHub. Main and master branches play the same role in Git.

🔸 The main branch the one where all changes eventually get merged back into is called master.

---

### 3 . Can you explain the difference between Git and GitHub?

🔸 **Git** is a versional control system or centralized. **Git is a version control system that allows developers to track changes in their code.**

🔸 **GitHub** is a distributed version control system.**GitHub is a web-based hosting service for Git repositories**

---

### 4\. How do you create a new repository on GitHub?

🔸 Please refer to my blog of Day8

**Link:** [`https://hashnode.com/draft/64d4af5619c597000f1db686`](https://hashnode.com/draft/64d4af5619c597000f1db686)

---

### 5\. What is the difference between local & remote repositories? How to connect local to remote?

🔸 **Local Repository:** The local repository is a Git repository that is stored on your computer.

🔸 **Remote Repository**: **The remote repository is a Git repository that is stored on some remote computer.**

**How to connect local to remote?**

🔸 Please refer to my blog of Day8

**Link:** [`https://hashnode.com/draft/64d4af5619c597000f1db686`](https://hashnode.com/draft/64d4af5619c597000f1db686)

---

## 💎 Tasks

### **Task-1:**

**💎 Set your user name and email address, which will be associated with your commits.**

```plaintext
# To set user name
git config --global user.name "userName"

# To set user email
git config --global user.email "userEmail@gmail.com"
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1694022328314/5660690c-2de1-4fab-95e3-d4a589a2b0d7.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1694022448863/812b73f0-39ab-4b7d-9b1b-3378630d10f8.png align="center")

---

### **Task-2:**

**💎 Create a repository named "Devops" on GitHub**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1694849106053/7d12e633-56b2-4076-a126-c3d4828963db.png align="center")

**💎 Connect your local repository to the repository on GitHub.**

```plaintext
git clone <url>
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1694849197798/d43af841-0035-415d-9369-c95e875a2aa1.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1694849246415/85644577-9cad-4580-ba1c-1b05b118ea72.png align="center")

**💎 Create a new file in Devops/Git/Day-02.txt & add some content to it**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1694849317425/e909dd92-8ecd-4008-8d39-0a6528d5942d.png align="center")

**💎 Push your local commits to the repository on GitHub**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1694849416032/24e0ff53-fe26-447d-b5ef-aef125b1db53.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1694849548478/6d5f1fec-fc80-47d2-94ca-2fada3afab0a.png align="center")

---
