Difference between Git and GitHub

Difference between Git and GitHub

Git

  • Git is a distributed version control system. It is a software tool that allows developers to track changes in their codebase and collaborate with others.

  • Git is primarily a command-line tool, although there are graphical user interfaces (GUIs) available.

  • It allows developers to create and manage repositories (collections of files and their change history), commit changes, branch code, merge branches, and more.

  • Git is decentralized, meaning that each developer has a complete copy of the repository on their local machine, enabling them to work offline and independently.

  • It is not dependent on a specific service or platform and can be used without an internet connection.

GitHub:

  • GitHub, on the other hand, is a web-based platform built on top of Git. It is often referred to as a "Git hosting service."

  • GitHub provides a web interface for Git repositories, making it easier to manage and collaborate on code. It offers features like pull requests, issues, code reviews, project management, and more.

  • It serves as a central platform where developers can store, share, and collaborate on Git repositories.

  • GitHub is not the only platform of its kind; there are alternatives like GitLab and Bitbucket.

Difference Between the Main Branch and Master Branch

  1. "Master" Branch:

    • Historically, "master" was the default and most commonly used name for the primary branch in Git. It is the branch where development typically begins and where the stable, production-ready code is expected to be found.

    • However, the use of the term "master" has been criticized for its association with slavery and other negative connotations. As a result, many in the tech industry have chosen to adopt more neutral and inclusive terminology.

  2. "Main" Branch:

    • "Main" is a more inclusive and neutral alternative to "master." Many Git hosting services and communities have transitioned to using "main" as the default branch name.

    • The "main" branch serves the same purpose as the "master" branch – it is typically the default and primary branch in a Git repository where the latest stable code is located.

How to create a new repository on GitHub

  1. After successfully setting up GitHub account login to your account.

  2. Click on the new repository option.

  3. After clicking the new repository option, we will have to initialize some things like naming our project, choosing the visibility etc. After performing these steps click the Create Repository button.

  4. After clicking the button, we will be directed to the below page. Right now the only file we have is a readme file.

  5. Now click on the “Upload files” button.

What is the Difference between local & remote repositories?

  1. Local Repository:

    • A local repository is a copy of the project's code and version history that resides on your local computer. It is typically located on your machine's file system.

    • It contains the complete history of the project, including all previous commits, branches, and tags.

    • You can work with a local repository without an internet connection.

    • A local repository is a private workspace where you can experiment and make changes before sharing them with others.

  2. Remote Repository:

    • A remote repository is a centralized repository hosted on a remote server, often on platforms like GitHub, GitLab, Bitbucket, or a company's internal server.

    • It serves as a collaboration point where multiple developers can push their changes and pull updates from others.

    • Remote repositories allow for collaboration and sharing of code with team members, contributors, or the public.

    • Changes in the remote repository are accessible to all team members, making it the central location for coordination and code sharing.

Today's Task:-

  • 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

Day 9 of #90daysofDevOps

Thanks for reading

Follow me for more about DevOps♾️........

________________________________________________________________________________

#90daysHardChallenge

#Cloudcomputing

#DevOps

#Shellscripting

#TrainWithShubham