Day 12 : Git & GitHub for DevOps Engineers
What is Git and Why is It Important?
Git is a distributed version control system (VCS) used to track changes in code. It allows multiple developers to work together and collaborate efficiently.
Version Control: Git keeps track of code changes, making it easy to revert to previous versions.
Collaboration: Multiple developers can work on the same project simultaneously without conflicts.
Branching and Merging: Developers can create branches to work on features independently and merge them later.
Distributed: Each developer has a full copy of the repository, ensuring no single point of failure.
What is the Difference Between the Main Branch and the Master Branch?
"main" and "master" are the primary branches in a repository. Traditionally, "master" was used, but "main" is now more common, especially on platforms like GitHub. This change was made to avoid controversial terms.
Can You Explain the Difference Between Git and GitHub?
Git: A tool installed on your local system to manage version control.
GitHub: A web-based platform that hosts repositories in the cloud, acting as a centralized system for collaboration. It also provides additional features like issue tracking, project management, and more.
How Do You Create a New Repository on GitHub?
To create a new repository on GitHub, you simply click the "New" button on the GitHub website, fill in the repository details, and click "Create repository."
What is the Difference Between a Local and Remote Repository? How to Connect Local to Remote?
Local Repository: A repository stored on your computer or server.
Remote Repository: A repository hosted on a cloud platform like GitHub.
To connect a local repository to a remote one,
Create a Local Repository:
Add a Remote Repository:
Push Local Changes to Remote:
Set Your Username and Email Address