Deep Dive in Git & GitHub for DevOps Engineers.

INTRODUCTION
Git is a version control system.GitHub is a web-based platform to share code with developers, open source, and write code. we can create a git repository without using commands.
What is Git and why is it important?

picture:1.0.Git
Git stands for Global information tracker and it is a version control system. Picture 1.0 shows the working principle of Git. Here data1 is a file that contains some code and data2 is the modified file of data1. By using version control that code was modified. In this example, we can also go to the older file(data1) and new file(data2) to do some version control operations i.e. edit information, retrieve information, delete files, and repository, etc. version control means we can edit, recover the deleted files or data, and access the older version code by entering some commands in the local system's(PC) terminal. Git stores the version control history. it helps us to secure the data, collaboration, and code management.
What is the difference Between Main Branch and Master Branch?
The main branch was created in the remote repository of GitHub(by default) whereas the master branch was created in the local repository.
Can you explain the difference between Git and GitHub?
Git is a version control system whereas GitHub is a web-based platform to share code, opensource, and write the code.
How do you create a new repository on GitHub?
To create a repository first go to GitHub.com and go to the right-side top corner "+" sign and click on it.

Then click the new repository and create the repository.

What is the difference between local & remote repository? How to connect local to remote?
A local repository was created in the local system(PC) whereas a remote repository was created in a server.
Set your user name and email address, which will be associated with your commits.
to set user name and email address the command is-:
git config --global user.email "user email id"
git config --global user.name "user name"

Create a repository named "Devops" on GitHub.
**Step 1-:**go to GitHub.com and go to the right-side top corner "+" sign and click on it.

**Step 2-:**Then Click the new repository and create the repository.

Step 3-: Click on create repository button now the "DevOps" repository was created successfully.

Connect your local repository to the repository on GitHub.
steps to connect from the local repository to the remote repository-:
step1-: Initialize Git in your local repository i.e.
git init
step2-:Add the remote repository: In the terminal or command prompt, run the following command to add the remote repository:
git remote add origin https://github.com/your-username/your-repository.git
step3-:Verify the remote repository:
git remote -v
Step4-:Push your local changes to GitHub:
git push origin master


Push your local commits to the repository on GitHub
steps to connect from the local repository to the remote repository-:
step1-: Initialize Git in your local repository i.e.
git init
step2-:Add the remote repository: In the terminal or command prompt, run the following command to add the remote repository:
git remote add origin https://github.com/your-username/your-repository.git
step3-:Verify the remote repository:
git remote -v
Step4-:Push your local changes to GitHub:
git push origin master


Create a new file in Devops/Git/Day-02.txt & add some content to it
step1-:to create a new file-
vi <filename>
or
touch <filename>

step2-: to commit the file command is-
git add <filename>





