git版本更新
git clone git://git.kernel.org/pub/scm/git/git.git
添加标签
$ git config --global user.name "jyz"
$ git config --global user.email jinyouzhi6@163.com
查看信息
git config --list
切换远程仓库地址
git remote set-url origin url #直接修改远程仓库地址
git remote rm origin #删除现有远程仓库
git remote add origin url #添加新远程仓库
git remote -v #查看远程仓库地址
git tag v0.1.2-light #创建轻量级标签
git tag -a v0.1 -m "version 0.1 released push url" d5a65e9 #创建附注标签
git show -a
git checkout [tagname/branchename] #切换标签或branche
git tag -d v0.1..2 #删除标签
git log --pretty=oneline --abbrev-commit #查看历史提交commit id
git tag -a v0.1.1 9fbc3d0 #给指定commit打标签
git push origin v0.1.2 #提交标签
git push origin -tags
版本回退
git reset --hard d5a65e #回退到指定commit id的版本
放弃本地修改
error: Your local changes to the following files would be overwritten by merge
git reset --hard
git pull
git log和git reflog 的区别:
git reflog 可以查看所有分支的所有操作记录(包括commit和reset的操作),包括已经被删除的commit记录,git log则不能察看已经删除了的commit记录