Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hands on with Version Control System: GIT (Part 2)

Hands on with Version Control System: GIT (Part 2)

This deck helps you to understand how to manage multiple branches, how to create a branch and merge & how to manage remote repositories.

Avatar for Dhrumil Shah

Dhrumil Shah

October 13, 2015
Tweet

More Decks by Dhrumil Shah

Other Decks in Programming

Transcript

  1. Remove file From staging area $git rm --cached test.txt From

    index and file system From index and file system $git rm test.txt
  2. Show log Entire $git log Date Filtering Date Filtering $git

    log --since=2.weeks $git log --since=“2 years 1 day 3 minutes ago”
  3. Show difference Unstagged changes $git diff Staged changes $git diff

    --cached $git diff --cached Relative to specific revision $git diff 17765f $git diff HEAD^
  4. Add remote repositories $git remote add origin <GIT URL> e.g.

    $git remote add origin https://github.com/dhuma1981/GDGAhmedabad_HOWGIT.git
  5. Cloning a remote repository $git clone <URL> e.g. $git clone

    https://github.com/dhuma1981/GDGAhmedabad_HOWGIT.git
  6. Switching branch Switch to already created branch $git checkout tester

    Create new branch and switch to it Create new branch and switch to it $git checkout -b developer
  7. Show all branches All branches $git branch $git branch -v

    Merged branches Merged branches $git branch --merged Unmerged branches $git branch –no-merged