git config --global user.name "名字" git config --global user.email "邮箱" git config --global core.autocrlf true git config --global core.safecrlf true mkdir dir cd dir git init git add file git commit -m 'commit message' 将本地的test分支追加到远程的master分支上面 git log --pretty=oneline --author='username' [alias] co = checkout ci = commit st = status br = branch hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short type = cat-file -t dump = cat-file -p git hist git checkout <hast> cat file git checkout master cat file git checkout master git status git checkout file git status cat file git status git add file git status git reset 或者 git reset HEAD file git checkout file git status git tag v1 git checkout v1^ cat file git tag v1-beta git checkout v1 git checkout v1-beta git tag git add file git commit -m 'message' git revert HEAD --no-edit git tag oops git reset --hard 标签 或者 git reset --hard <hast> git hist --all git tag -d oops git add file git commit --amend -m 'message' a. mkdir lib git mv file lib b. mkdir lib mv file lib git add lib/file git rm file