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

ยท

2 min read

What is Git? why is it important?

Git is like a super-smart assistant for keeping track of changes in computer code. It's like a time machine that helps developers manage the different versions and track the history of their work. Introduced in 2005, Git has become the go-to tool for software developers.

Imagine you're working on a project with others. Git allows you to save different versions of your work, so if something goes wrong, you can easily go back to a previous, working version. It's like having a safety net for your code.

What is difference Between Main Branch and Master Branch?

The terms "main" branch and "master" branch in Git basically refer to the default branch in a repository where all the main work happens. In the past, "master" was the common term, but recently, many folks are using "main" to be more inclusive and avoid any potentially negative historical connotations associated with the word "master."

The difference between Git and GitHub?

GitGitHub
Git is a version control system.GitHub is a platform.
Operates locally on your computer.Operates in the cloud.
Keeps track of changes made to source code.Used for hosting Git repositories.
Manages the history of the project.Facilitates collaboration, sharing, and contribution.
Allows reverting to previous versions and facilitates collaboration.Provides a web-based interface.

Task 1 : Set your user name and email address, which will be associated with your commits.

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

Replace "Your Name" with your actual name and "your.email@example.com" with your email address. The --global flag ensures that this configuration is applied globally across all your Git repositories.

Task 2 : Create a repository named "Devops" on GitHub

  • Connect your local repository to the repository on GitHub.

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

  • Push your local commits to the repository on GitHub

ย