Git & Github for Devops

Git & Github for Devops

·

4 min read

Table of contents

No heading

No headings in the article.

  1. What is Git and why is it important?

    Git is distributed version control system, developed by 'linus torvald' in 2005,

    Used to manage source code.

    Here are some reasons why Git is important:

    1. Collaboration: Git allows multiple developers to work on the same codebase simultaneously and collaborate on changes. This helps to speed up development and improves overall efficiency.

    2. Version Control: Git enables version control, which means that developers can keep track of changes made to the codebase over time. This makes it easy to revert to an earlier version if something goes wrong or to compare different versions of the code.

    3. Branching and Merging: Git allows developers to create different branches of the codebase and work on different features or fixes simultaneously. This makes it easy to isolate changes and test them independently before merging them back into the main codebase.

    4. Backup and Recovery: Git repositories serve as a backup of the codebase and can be used to recover lost or deleted files. This is particularly important for critical projects where losing code could result in significant downtime or financial losses.

    5. Open Source: Git is an open-source project, which means that it is free to use and can be modified by anyone.

  2. What is the difference Between Main Branch and Master Branch??

    In general, the main branch and the master branch are the central branches in a Git repository, and they are used to track the current state of the project's source code. The main branch is the branch to that developers are expected to commit their changes to, and it is the branch that is used to create releases of the project. The master branch is a special branch that is used to track the main branch and ensure that the project's source code is always in a stable and deployable state

  3. How do you create a new repository on GitHub?

    1. First, log in to your GitHub account.

    2. On the GitHub home page, click the "+" sign in the top right corner of the screen and select "New repository" from the drop-down menu.

    3. On the "Create a new repository" page, enter a name for your repository in the "Repository name" field.

    4. Optionally, you can add a description for your repository in the "Description" field.

    5. Choose whether you want your repository to be public or private. Public repositories are visible to everyone, while private repositories are only visible to you and those you grant access to.

    6. If you want to initialize your repository with a README, license, or .gitignore file, select the corresponding options.

    7. Choose a license for your repository if you want to include one. If you don't want to include a license, select "None".

    8. Click the "Create repository" button to create your new repository.

    9. Your new repository is now created and you can start adding files and making changes to it. You can also clone the repository to your local machine using the Git command line or a Git client like GitHub Desktop.

4.Difference between Git and GitHub?

GIT

GITHUB

Git is a software.

GitHub is a service.

Git is a command-line tool

GitHub is a graphical user interface

Git is installed locally on the system

GitHub is hosted on the web

Git is maintained by Linux.

GitHub is maintained by Microsoft.

Git is focused on version control and code sharing.

GitHub is focused on centralized source code hosting.

Git is a version control system to manage source code history. 

GitHub is a hosting service for Git repositories.

Git was first released in 2005. 

GitHub was launched in 2008.

Git is open-source licensed.

GitHub includes a free tier and a pay-for-use tier.

Git has minimal external tool configuration.

GitHub has an active marketplace for tool integration.

Git provides a Desktop interface named Git Gui.

GitHub provides a Desktop interface named GitHub Desktop.

A local repository is a repository that stores in the local machine. A remote repository is a copy of the Git Repository which is stored on a service or web hosting service like GitHub.

How to connect local to remote?

  1. Create a new remote repository on a hosting service like GitHub, GitLab, or Bitbucket.

  2. In your local repository, use the "git remote add" command to add a new remote repository.

To set your user name and email address in Git,

To set your user name

To set your email address:

Thanks for Reading !!