Tuesday, September 6, 2011

Some useful GIT tips

revert the last commit as it never was
# git reset --hard HEAD^

delete remote git branch
# git push origin :branchName

sync remote branches (removes tracking branch if remote branch was deleted)
# git remote prune origin

delete local branch links if they were deleted on origin
# git remote prune origin

create branch with a link to remote repository
# git checkout --track -b deployCandidate origin/deployCandidate

git config list
# git config -l

git show repository changes history
# git reflog
(to get to the some state run from reflog)
# git reset --hard HEAD@{0}

git show diff between what is commited (but not pushed) and the repository
# git diff HEAD^

colors in git put this to .git/config:
[color]
  branch = auto
  diff = auto
  status = auto
[color "branch"]
  current = yellow reverse
  local = yellow
  remote = green
[color "diff"]
  meta = yellow bold
  frag = magenta bold
  old = red bold
  new = green bold
[color "status"]
  added = yellow
  changed = green
  untracked = cyan

1 comment:

  1. Betting on poker in NJ: Odds and Strategies | JTM Hub
    The main bet 광양 출장마사지 types of online poker are: 거제 출장샵 Single 태백 출장마사지 or Multi or Double Double; High-stakes 보령 출장안마 and Multi-Double; High-Rollers 당진 출장마사지 Poker; High-Rollers Poker.

    ReplyDelete