command
create new branch
git branch development
switch existing branch
git checkout
check current branch
git branch
[22:25:38 - 14-07-22] /Users/toripiyo/program/angularjs/logging % git branch
* development
master
git diff
check the difference with latest commit
git diff HEAD .gitignore
check the difference commits of specific file
git diff <commit>..HEAD spec/foo.rb
prevent git from using a pager
git --no-pager log
revert specific file to specific commit
git checkout <commit> filepath
git log
show file name
git log --name-status
git reset
delete unnecessary commit
git reflog
show commit reference
git reflog
trouble shooting
error: cannot lock ref
$ git pull
error: cannot lock ref 'refs/remotes/origin/hogehoge/hugahuga': 'refs/remotes/origin/hogehoge' exists; cannot create 'refs/remotes/origin/hogehoge/hugahuga'
From github.com:Org/Repo
! [new branch] hogehoge/hugahuga -> origin/hogehoge/hugahuga (unable to update local ref)
Reason: "hogehoge" file and "hogehoge" dir can't coexist. Reflect latest remote repository info if remote repository no longer has "hogehoge" branch.
git fetch --prune
search issues by filter
- by username and repository
repo:hogehoge-user-name/something-repo-name
reference
3.1 Git Branching - What a Branch Is
http://git-scm.com/book/en/Git-Branching-What-a-Branch-Is