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.

Dhrumil Shah

October 13, 2015
Tweet

More Decks by Dhrumil Shah

Other Decks in Programming

Transcript

  1. Configuration Identity $git config --global user.name “Dhrumil Shah” $git config

    --global user.email “dhuma1981@gmail.com” $git config --global user.email “dhuma1981@gmail.com”
  2. Remove file From staging area $git rm --cached test.txt From

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

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

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

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

    https://github.com/dhuma1981/GDGAhmedabad_HOWGIT.git
  7. 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
  8. Show all branches All branches $git branch $git branch -v

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