Thursday, July 3, 2014

Git Tips

Git Tips


  • Colorize Git Output
    • git config --global color.branch auto
    • git config --global color.diff auto
    • git config --global color.interactive auto
    • git config --global color.status auto
  • Git User Name
    • git config -l
    • git config --global user.name "User Name"
    • git config --global user.email "User@Name.tld"
    • git config --local user.name "User Name"
    • git config --local user.email "User@Name.tld"
  • Git Editor 
    • git config --global core.editor vim
    • Set Custome diff for git diff
    • git config --local diff.tool kompare
    • git config --local difftool.prompt false
    • git config --local alias.mydif difftool
    • how to use $> git mydif
    • how to use $> git difftool
    • Additional diff tool
    • $> git config --local alias.vimdiff "difftool -t vimdiff"
    • git config --local alias.meld "difftool -t meld"
      git config --local alias.kompare "difftool -t kompare"

      git config --local difftool.prompt true # Confirm user to open diff
      git config --local difftool.prompt false # Dont Confirm , Just open diff
    • How to use $>git vimdiff [file]
  • Basic Comamnds 
    • cd /var/tmp/a
    • git init
    • git add file
    • git commit
    • git log
    • git status
    • git diff
    • Create Clone
      • git clone file://var/tmp/a file://var/tmp/b
    • Create new Branch 
      • cd /var/tmp/a
      • git branch featureA master
      • # Change branch
      • git checkout featureA
    • Track remote branch
      • cd /var/tmp/b
      • git branch --track featureA origin/featureA

No comments:

Post a Comment