What is GIT? and WHY is it Important? EXPLAINED in a NutShell; Including EverydayGIT commands

What is GIT? and WHY is it Important? EXPLAINED in a NutShell; Including EverydayGIT commands

WHAT IS GIT?

  1. Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

  2. In simple terms, Git is a command line tool that helps with version control in various manner

    • Allowing us to keep track of changes we make to our code by saving in small snippets of our code at a given point in time.
    • Allows us to synchronize code between different developers working on the same project by allowing n number of people to pull information from and push information to a repository stored on GitHub.
    • Allowing us to make changes to and test out code on a different branch without altering our main code base, and merging the two together.
    • Allowing us to revert back to earlier versions of our code if we realize there is a mistake made by us.

--- We mentioned above the word Repository

—> A Git Repository is a file location where we'll store/save all of our files relevant to a project.

—> These can either be remote (stored on GitHub) or local (stored on your computer)


Everyday Usage Git Commands

For Understanding, Git users can broadly be grouped into four categories for the purposes of describing here a small set of useful command for everyday Git usage

Individual Developer (Standalone) commands are essential for anybody who makes a commit, even for somebody who works alone.

If you work with other people, you will need commands listed in the Individual Developer (Participant) section as well.

People who play the Integrator role need to learn some more commands in addition to the above.

Repository Administration commands are for system administrators who are responsible for the care and feeding of Git repositories.

Individual Developer (Standalone)

A standalone individual developer does not exchange patches with other people, and works alone in a single repository, using the following commands.

git-init to create a new repository.

git-log to see what happened.

git-switch and git-branch to switch branches.

git-add to manage the index file.

git-diff and git-status to see what you are in the middle of doing.

git-commit to advance the current branch.

git-restore to undo changes.

git-merge to merge between local branches.

git-rebase to maintain topic branches.

git-tag to mark a known point.


Individual Developer (Participant)

A developer working as a participant in a group project needs to learn how to communicate with others, and uses these commands in addition to the ones needed by a standalone developer.

git-clone from the upstream to prime your local repository.

git-pull and git-fetch from "origin" to keep up-to-date with the upstream.

git-push to shared repository, if you adopt CVS style shared repository workflow.

git-format-patch to prepare e-mail submission, if you adopt Linux kernel-style public forum workflow.

git-send-email to send your e-mail submission without corruption by your MUA.

git-request-pull to create a summary of changes for your upstream to pull.


Integrator

A fairly central person acting as the integrator in a group project receives changes made by others, reviews and integrates them and publishes the result for others to use, using these commands in addition to the ones needed by participants.

This section can also be used by those who respond to git request-pull or pull-request on GitHub (github.com) to integrate the work of others into their history. A sub-area lieutenant for a repository will act both as a participant and as an integrator.

git-am to apply patches e-mailed in from your contributors.

git-pull to merge from your trusted lieutenants.

git-format-patch to prepare and send suggested alternative to contributors.

git-revert to undo botched commits.

git-push to publish the bleeding edge.


Repository Administration

A repository administrator uses the following tools to set up and maintain access to the repository by developers.

git-daemon to allow anonymous download from repository.

git-shell can be used as a restricted login shell for shared central repository users.

git-http-backend provides a server side implementation of Git-over-HTTP ("Smart http") allowing both fetch and push services.

gitweb provides a web front-end to Git repositories, which can be set-up using the git-instaweb script.

Downloads

1) For Windows User :

[Downloading Git] (git-scm.com/download/win)

2) For Mac User :

[Git - Downloading Package] (git-scm.com/download/mac)