#Devops Day9
Hello, everyone, This is my Nine blog started my day9 as AWS DevOps Engineer #90daysofchallenge with ShubhamLondhe #devops #trainwithshubham.
Deep Dive in Git & GitHub for DevOps Engineers.
What is Git and why is it important?
Ans:- Git stand for Global information Tracker. It is basically a version control system. It is Controlled by a system known as Git Basically a whatever information you want to keep a track off. Git is just a tool that allows u to version control your files, folder, images, etc. E.g. Hello ->version 1 , Hello Dosto -> version 2 .Most of the company in the world are used git to version control their system.
What is difference Between Main Branch and Master Branch??
Ans:- The main branch and master branch are the same thing in git. however, main is now the preferred term in many projects to replace "master" due to historical association.
Can you explain the difference between Git and GitHub?
Ans:- Git is a version control system that tracks changes on your computer. GitHub is a web platform that hosts Git repositories and offer collaboration tool online. Git is the tool, and GitHub is the platform.
How do you create a new repository on GitHub?
Ans: -> Log in to your GitHub account.
-> Click the "+" icon in the top right.
-> Select "New Repository".
-> Enter a name, description, and other settings.
-> Click "Create repository".
What is difference between local & remote repository? How to connect local to remote?
Ans:- Local repository is on your computer , remote repository is on a server(e.g., GitHub).To connect, create a remote repository, link it to your local repository with "git remote add", and push code to the remote with "git push".
Task-1:
Set your user name and email address, which will be associated with your commits.
Ans->You can use the git config command to set user name email the email address you associate with your Git commits.
Task-2:-
Create a repository named "DevOps" on GitHub.
Ans ->Go to the GitHub website.
->Log in to your GitHub account.
->Click on the "+" sign in the top right corner of the page.
->Select "New repository" from the dropdown menu.
->Name your repository "DevOps".
->Optionally, provide a description for your repository.
->choose public or private repository settings based on your preference.
->Initialize this repository with a README if you want to add a README file.
->Click the "Create repository" button.
Connect your local repository to the repository on GitHub.
Ans:- I. Clone the GitHub Repository.
II. Navigate to the Local Repository.
III. Configure Git Remote.
IV. Verify the Connection.
V. Push Changes to GitHub.
Create a new file in Devops/Git/Day-02.txt & add some content to it.
Ans:- >Navigate to the Repository.
-> Create the New File.
-> Edit the File
-> Add and Commit Changes.
-> Push Changes to GitHub
Push your local commits to the repository on GitHub.
->Ensure you are in the Local Repository
cd /path/to/DevOps/Git
->Commit Changes:
git add . git commit -m "Your commit message here".
-> Push Changes to GitHub:
git push origin master