GIT Basics

Contributors
Rishabh Singh / @stalwart201

What is GIT?

HISTORY OF GIT

what is VCS?

  • It allows developers to work simultaneously.
  • It does not allow overwriting each other’s changes.
  • It maintains a history of every version.

Distributed Version Control System

Why Git?

  • You can use git even when you're offline.
  • Create branches, work locally, isolate your work and merge seamlessly.
  • Code revisions (commit) that you made would be available to only you locally unless you push to remote repo.

What is github?

Differnce between Git and Github

Installing git on Linux

  • For Fedora users:
  • $ sudo yum install git-all

  • For Debian users:
  • $ sudo apt-get install git-all

GIT WORKFLOW

Obtain repo

git init

git clone "url"

Create branch

git branch {branch name}

Switching to other branch

git checkout {branch name}

Make changes

Stage changes

git add {filename}

Commit changes

git commit -m “Commit message”

Merging

git merge origin/master

Push changes to remote area

git push {remote_name} {repo_name}

Git help

  • $ git help <verb>
  • $ git <verb> --help
  • $ man git-<verb>

Learn GIT flow

git-scm

github guides

git in 15 minute