Day 12 Task: Deep Dive in Git & GitHub for DevOps Engineers
What is Git and why is it important?
It is a tool for source code management. It track the changes you make in files . And provide a platform for developers to work together. And github help team members to work together in project from any location.
What is the difference between Main Branch and Master Branch?
Main Branch: Creating new Repository in github is the main branch which is primary. Master Branch: And the master branch is deafult in git Repo.
Can you explain the difference between Git and GitHub?
Git is free to use and open source version control system. git is used to track the directories and files and is installed locally in machine and provide a CLI, while Github is cloud service developers push there code in Github. And github is used in web hoisting. and provides a GUI.
How do you create a new repository on GitHub?
The following are some steps to create a Repo in Github:
Open the github Repo and click on New repository :
Now create new repository in the field and click on the green button in bottom.
Next step view in the blue border text and click on the creating a new file
Now write the Repo name and add some content and click on the commit changes button.
What is the difference between a local & remote repository? How to connect local to remote?
Local repo is installed in your local Machine which is git and remote Repo is your web browser which is github. Both works same but git work in Cli and github in Gui.
Connect local to Remote:
First Select a Repo From github you can read it from previous content Create a folder in your local machine:
Now go to your github Repository and click on the code button and copy the local HTTP link:
Go to your local machine and write the command git clone URL
Tasks
Task 1:
- Set your user name and email address, which will be associated with your commits.
read the above code for user and email.
Task 2:
Create a repository named "DevOps" on GitHub.
Connect your local repository to the repository on GitHub.
First click on your profile in right top and click on the settings
Now click on the open SSh and GPG keys
Click on the New SSH key.
Now Stop first go to your local machine and make ssh keys
now the last command cat id_ed25519.pub this key write it in Key field and Add Ssh key
Now got to your local machine and write commands and run
now go to your github repository and you can see the day02 file is added.