$ git config--global user.name "用户名"
$ $ git config--global user.email" [email protected]"
$ git config--global core.editor Vim
$ git config-list
$ git config--global alias.co checkout $ git config--global alias.br branch $ git config--global alias.ci commit $ git config--global alias.st status
$ git init <仓库名称>
$ git clone <远程URL>
$ git add Filename
$ git add *
$ git commit-m "提交消息"
$ git diff
$ git diff--staged
$ git diff HEAD
$ git diff Git Diff Branches: $ git diff < branch 2>
$ git status
$ git show <选项> <对象>
$ git log
$ git log-oneline
$ git log-stat
$ git log-p
$ git blame <file name>
$ touch .gitignore List the ignored files: $ git ls-files-i--exclude-standard
$ git branch
$ git branch-dDelete a remote Branch:
$ git push origin-deleteRename Branch:
$ git branch-m
$ git checkout
$ git checkout-b Checkout a Remote branch: $ git checkout
$ git stash
$ git stash save ""
$ git stash list
$ git stash apply
$ git stash show
$ git stash pop
$ git stash drop
$ git stash clear
$ git stash branch
$ git cherry-pick
$ git merge commit
继续rebasing进程:$ git rebase
$ git rebase-continue # Abort the rebasing process: $ git rebase--skip
$ git rebase-i
$ git remote-v
$ git remote add <short_name> <remote_URL>
$ git fetch <远程>
$ git remote rm <目标>
$ git remote rename <旧名称> <新名称>
$ git remote show <远程>
$ git remote set-url <远程名称>
$ git push origin master Pull data from remote server: $ git pull origin master
$ git push <远程> <分支> $ git push-f
$ git push origin-delete edited
$ git pull origin master
$ git pull <远程分支URL>
$ git fetch <分支网址> <分支名称>
$ git fetch-all
$git fetch origin
$git revert branch_name
$ git reset-hard $ git reset-soft: $ git reset--mixed
$ git rm <file Name>
$ git rm--cached
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)