Last Updated: February 25, 2016
·
487
· subicura

favorite git command

  • setting
# show config list
git config -l
# set user name & email
git config --global user.name "subicura" # set global user.name
git config --global user.email "subicura@subicura.com" # set global user.email
git config user.name "chungsub kim" # set project user.name
git config user.email "chungsub.kim@purpleworks.co.kr" # set project user.email

# set color setting
git config --global color.branch auto
git config --global color.diff auto
git config --global color.interactive auto
git config --global color.status auto

# unset
git config --global --unset color.status 
  • basic command
git status
git pull
git push
git commit -v -a
  • remote info
git remote -v
git remote show
git remote show origin
  • local branch
git branch # show
git checkout -b testing # make and chang
git checkout master # change
git merge testing # merge with branch
git branch -d testing # delete branch
  • remote branch
git branch -a # show all local&remote branch
git branch -vv # show branch/remote branch
git push origin master:testing # make remote branch
git push origin testing # make remote branch
git checkout -b testing origin/testing # use remote branch
git push origin :testing # remove remote branch
git remote set-url origin git@localhost:test/test.git # change url
  • tag
git tag # tag list
git tag -a v1.4 -m 'my version 1.4' # make tag
git tag -a v1.2 9fceb02 # make tag revision
git show v1.4 # show tag
git push origin v1.5 # push tag
git tag -d v1.4