标签:
四级模式
工作区 暂存区 本地仓库 远程仓库
git config --global user.name "YourName"
git confit --global user.email "YourEmail"
git init
git add file
git commit -m "someComments"
git status
git diff file 查看工作区和本地仓库的不同
git log --pretty=oneline
git reset --hard HEAD^ (HEAD~100)
git reset --hard 123456(版本号)
git reflog
git diff HEAD -- file 最新版本和工作区的区别
git checkout -- file 和工作区或版本库的一样 也可以用于恢复误删
git reset HEAD file
git rm file 删除后直接commit
SSH-keygen -t rsa -C "YourEmail"
Git remote add origin git@github.com:blueflag417/test1.git
Git push -u origin master 推送master并建立联系 (git push origin master)
git clone git@github.com:blueflag417/gitSkills.git
git branch
git branch dev + git checkout dev = git checkout -b dev
git merge dev
git branch -d dev
git log --graph --pretty=oneline --abbrev-commit (git log --graph)
git merch --no-ff -m "some comment" dev
git stash
git stash apply + git stash drop = git stash pop
git stash apply stash@{0}
git stash list
git branch -D dev 强行删除分支
git remote (-v)
git checkout -b dev origin/dev
git pull
git branch --set-upstream dev origin/dev
git tag
git tag name
git tag name 123456
git show name
git tag -a name -m "some conmmont" 123456 (git tag -s name -m "some conmmont" 123456)
git tag -d name
git push origin name
git push origin --tags
git push origin:refs/tags/name
git config --global color.ui true
.gitignore
git config --global alias.st "status "
标签:
原文地址:http://www.cnblogs.com/kiscall/p/4391547.html