Day-9 of DevOps Challenge: Basic Git & GitHub for DevOps Engineers

Day-9 of DevOps Challenge: Basic Git & GitHub for DevOps Engineers


Why Git is important?

Git is important for several reasons, particularly in the context of software development and project management:

Version Control Track Changes: Git allows you to track changes in your codebase over time. You can see who made what changes, when, and why. Revert Changes: If something goes wrong, you can easily revert to a previous version of your project.

Collaboration Multiple Contributors: Git supports multiple people working on the same project simultaneously. Changes from different contributors can be merged together

Branching and Merging: Developers can work on separate branches to develop features, fix bugs, or experiment without affecting the main codebase. Branches can later be merged back into the main project.

Distributed Development Local Repositories: Every developer has a complete copy of the repository, including its history. This means you can work offline and commit changes locally, then sync with the remote repository when you're back online.

Efficiency and Performance Speed: Git is designed to be fast. Operations such as committing, branching, merging, and viewing history are optimized for performance.

Flexibility Workflow Customization: Git supports various workflows and can be adapted to fit the needs of different teams and projects. Integration: Git integrates well with other tools and platforms, such as GitHub, GitLab, Bitbucket, CI/CD pipelines, and various IDEs.

Community and Ecosystem Wide Adoption: Git is the most widely used version control system in the software industry, which means there is a large community and a wealth of resources, tutorials, and support available. Support for Open Source: Git is the backbone of many open-source projects. Platforms like GitHub and GitLab have further enhanced Git's capabilities, making it easier to manage and contribute to open-source projects.

DevOps and CI/CD Continuous Integration and Deployment: Git integrates seamlessly with CI/CD tools and services, enabling automated testing, building, and deployment processes.

What is difference Between Main Branch and Master Branch??

If we are using Git in a local repository, then the branch starts from 'master'. However, when creating a repository on GitHub, the branches start from 'main'.

What is difference between Git and GitHub?

Git is the core technology that manages version control locally on your machine, while GitHub is a cloud-based platform built around Git that provides collaboration, project management, and social coding features. Many other platforms like GitLab and Bitbucket also provide similar services to GitHub but with varying features and pricing models.

How do we create a new repository on GitHub?

To create a new repository on GitHub, sign in to your account. Click on the +" (plus sign) in the top-right corner and select "New repository". Enter a name, description (optional), choose public or private visibility, and optionally initialize with a README, add a .gitignore, and select a license. Click "Create repository" to finish

What is difference between local & remote repository? How to connect local to remote?

Local Repository:

Location: A local repository resides on your local machine, typically where you do your development work.

Functionality: It stores all the files and revision history of your project locally. You can commit changes, create branches, merge branches, and view the history of changes without needing an internet connection.

Remote Repository:

Location: A remote repository is hosted on a server or a cloud-based platform like GitHub, GitLab, or Bitbucket.

Functionality: It serves as a central hub where your local changes can be shared with others and where you can collaborate with team members. Remote repositories enable you to synchronize your local repository with the changes made by others, manage access control, and integrate with various collaboration tools.

Set your Git remote URL to use HTTPS with your username and the generated token

git remote set-url origin https://username:[email protected]/username/repository.git

Check Remove connection via provided commands

Git Remote -V


I have performed some tasks that might help everyone Git and Github


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

Create a repository named "Devops" on GitHub

To create a new repository on GitHub, sign in to your account. Click on the +" (plus sign) in the top-right corner and select "New repository". Enter the name "Devops", description (optional), choose public or private visibility, and optionally initialize with a README, add a .gitignore, and select a license. Click "Create repository" to finish

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

Shubham Londhe TrainWithShubham

要查看或添加评论,请登录

Akash Rastogi的更多文章

社区洞察

其他会员也浏览了