Skip to main content

All you Need to Know about Version Control System

Git & GitHub

Introduction

If you’re new to programming or if you’ve joined a company you’ve heard about the terms Git & Github. Git was created by Linus Torvald.

Let’s understand more about Git……..!

What is Git?

Git is a Distributed Version Control System whose goals include speed, data integrity, and support for distributed, non-linear workflows.

Why Git?

It’s free # light weight Open Source # Work’s Offline Superfast # Easy to learn Scalable # Undo is easy Cheap merging/branching # Go with the flow


The basic Git workflow goes something like this:

  1. You modify files in your working tree.
  2. You selectively stage just those changes you want to be part of your next commit, which adds only those changes to the staging area.
  3. You do a commit, which takes the files as they are in the staging area and stores that snapshot permanently to your Git directory.

GitHub

GitHub is an open-source version-control and collaboration platform for software developers. GitHub, which is delivered through a software as a service (SaaS) business model, was started in 2008 and was founded on Git. GitHub can be thought of as a serious social networking site for software developers.

Why GitHub?

Because GitHub is so intuitive to use and its version control tools are so used for collaboration, non-programmers have also begun to use GitHub to work on document-based and multimedia projects. Additionally, anyone can sign up and host a public code repository for free, which makes GitHub especially popular with open-source projects.




Advanced features of GitHub!

  • Github pages # Packages

  • Github-MarketPlace # WebHooks

  • Code review Deployments

  • Easy API calls # Environments

  • Workflow Visualization Workflow templates

What is Arctic Code Vault Contributor Batch?

The GitHub Arctic Code Vault is a data repository preserved in the Arctic World Archive (AWA), a very-long-term archival facility 250 meters deep in the permafrost of an Arctic mountain. 

The snapshot included any public repository that had at least 250 stars, Clicking on the Arctic Code Vault Contributor badge in the highlights section of a profile will reveal which of a user’s projects were saved in this snapshot.GitHub created the Arctic Code Vault Badge to honour the millions of developers worldwide who contributed to the open-source project. This badge is displayed in the highlights section of the developer’s GitHub profile.

Git Commands


  • SETUP INIT

    • git config-global username [Firstname Lastname]

      • Set name that is identifiable for credit when reviewing version history

    • git config-global usermail[valid email]

      • Set an email address that will be associated with each history maker

    • git config-global color UI auto 

      • Set automatic command line for git for easy writing 

    • git init 

      • Initialize an existing repository as a git repository 

    • git clone

      • Retrieve an entire repository from a hosted location via URL

  • STAGES & SNAPSHOTS

    • git  branch 

      • List branches (the asterisk denotes the current branch)

    • git branch -a

      • List all branches (local and remote)

    • git branch[branch-name]

      • Create a new branch at the current commit

    • git checkout

      • Switch new another branch and check it out

    • git merge

      • Merge the specified branches history into the current one

    • git diff-staged

      • Show modified files in the working directory staged for your next committed

    • git commit [descriptive message]

      • Commit your staged content as a new commit snapshot

  • BRANCH & MERGE

    • gt branch 

      • Show modified files in the working directory staged for your next comment

    • git add [file]

      • Add the file as it looks wow to your next commit 

    • git reset [file]

      • Unstaged a file while remaining the changes in the working directory

    • git diff

      • A difference of what is staged but not yet committed

  • INSPECT & COMPARE

    • git log

      • Show all commits in the current branch history

    • git log branch_B…..branch_A

      • Show all commits that are in branch A that   are not on branch B

    • git log -- stat-M

      • Show all commit logs with an indication of any path that move

  • SHARE & UPDATE

    • git remote add [alias][URL]

      • Add git as an alias

    • git merge [alias]/[branch]

      • Merge a remote branch into a current branch to bring it up to date

    • git push [alias][branch]

      • Transmit local branch commit to the remote repository

    • git pull

      • Fetch and merge any commit from the tracking remote 

Comments