Deep Dive in Git & GitHub for DevOps Engineers :

Deep Dive in Git & GitHub for DevOps Engineers :

What is Git and why is it important?

Git is a version control system. It maintains a history of all changes made to the code. The changes are stored in a special database called “repository”, also known as “repo”.

it is important because of Tracking the changes and updates. We can see who made which changes. Git also provides when and why a change was made.

Allowing them to work collaboratively. Software development projects usually require many people to work together. Git provides developers with a systematic way of doing that. Thus, the developers focus on the project instead of extensive communication sessions between the other developers.

What is difference Between Main Branch and Master Branch?

Main?or?master?is the default branch when you create a repository. GitHub now uses main as its default branch while others still use master.

Earlier, Microsoft GitHub also has mastered as their default branch, but some peoples at Microsoft think that the?master?name is kind of similar to slavery, which is offensive according to Microsoft. Hence they changed its name to?main.

Can you explain the difference between Git and GitHub?

  • Git :

  1. Git is a software.
  2. Git is a command-line tool
  3. Git is installed locally on the system
  4. Git is maintained by Linux.
  5. Git is open-source licensed.

  • GitHub :

  1. GitHub is a service.
  2. GitHub is a graphical user interface.
  3. GitHub is hosted on the web.
  4. GitHub is maintained by Microsoft.
  5. GitHub includes a free tier and a pay-for-use tier.

How do you create a new repository on GitHub?

Go to the GitHub websiteand log in to your account.

In the top-right corner of the screen, click the plus (+) button and select "New repository" from the drop-down menu.

On the next page, enter a name for your repository, a short description (optional), and select whether you want the repository to be public or private. Public repositories are visible to anyone, while private repositories can only be accessed by you and the people you invite.

You also have an option of initializing the repository with a README file or add a git ignore and a license.

Once you're done, click the "Create repository" button.

The new repository will be created and you will be taken to the repository's main page, where you can see the files in the repository and manage the repository's settings.

No alt text provided for this image

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

A local repository is a version of a project that is stored on your own machine, while a remote repository is a version of a project that is stored on a separate machine or server, such as on a hosting service like GitHub or GitLab.

One of the main differences between a local and remote repository is that a local repository is only accessible to you on your own machine, while a remote repository is typically accessible to multiple people over the internet. This makes it easy for multiple developers to collaborate on the same codebase, even if they are working from different locations.

Another difference is that a local repository typically stores the entire history of the project, including all of its commits and branches, while a remote repository may only store the most recent version of the project.

To connect a local repository to a remote repository, you need to do the following:

  1. First, create a new repository on the remote such as GitHub.
  2. On your local machine, navigate to the local repository you want to connect to the remote repository.
  3. Add the remote repository as an origin to your local repository using the git command git remote add origin .
  4. Push your local repository's master branch to the remote repository using the command git push -u origin master. This command will upload the entire history of your local repository to the remote repository.
  5. From then on, you can work on the local repository, then push your changes to the remote repository to share them with other collaborators, and also pull the changes made by others to your local repository.

Tasks :

Task 1 :

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

No alt text provided for this image

Task 2 :

  • Create a repository named "Devops" on GitHub

No alt text provided for this image
No alt text provided for this image

  • Connect your local repository to the repository on GitHub.

No alt text provided for this image

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

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

  • Push your local commits to the repository on GitHub.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Thank you for reading! I hope you find this article helpful.

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

Nihal Apretwar的更多文章

  • SQS (Simple Queue Service):

    SQS (Simple Queue Service):

    What is SQS: Amazon Simple Queue Service (SQS) is a managed message queuing service technical professionals and…

  • Amazon S3: (Simple Storage service):

    Amazon S3: (Simple Storage service):

    What is S3: It provides object storage which is build for storing and recovering any amount of data from anywhere over…

  • Elastic Compute Cloud (EC2)

    Elastic Compute Cloud (EC2)

    What is EC2 : Amazon EC2 Provides secure and resizable compute capacity in the AWS cloud. You can use Amazon EC2 to…

  • IAM (Identity and Access Management)

    IAM (Identity and Access Management)

    IAM : AWS identity access management is a web service that help you securely control access to AWS resources. You use…

  • AWS (Amazon Web Services)

    AWS (Amazon Web Services)

    What is AWS ? AWS stands for Amazon web services. AWS is a secure cloud service platform that provides on-demand…

    1 条评论
  • Jenkins Declarative Pipeline:

    Jenkins Declarative Pipeline:

    One of the most important parts of your DevOps and CICD journey is a Declarative Pipeline Syntax of Jenkins. Some…

  • Complete Jenkins CI/CD Project - Continued with Documentation

    Complete Jenkins CI/CD Project - Continued with Documentation

    I can imagine catching up will be tough so take a small breather today and complete the Jenkins CI/CD project from Day…

    6 条评论
  • Complete Jenkins CI/CD Project:

    Complete Jenkins CI/CD Project:

    Let's make a beautiful CI/CD Pipeline for your Node JS Application ?? Task-01: Fork this repository: Create a…

    1 条评论
  • Jenkins Freestyle Project for DevOps Engineers:

    Jenkins Freestyle Project for DevOps Engineers:

    What is CI/CD? CI or Continuous Integration is the practice of automating the integration of code changes from multiple…

  • Getting Started with Jenkins:

    Getting Started with Jenkins:

    What is Jenkins? Jenkins is an open source continuous integration-continuous delivery and deployment (CI/CD) automation…

    2 条评论

社区洞察

其他会员也浏览了