git alias:git命令别名,使用git更加方便快捷:
git config --global alias.co checkout # 别名
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.br branch
git config --global alias.psm 'push origin master'
git config --global alias.plm 'pull origin master'
git config --global alias.lg "log --graph --pretty=
format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
--abbrev-commit --date=relative"
git checkout:可以切换分支,切换tag,切换具体commit,除此之外,git checkout还能撤销还没有add进暂存区的文件
git statsh:意思是把当前分支下所有没有commit的代码先暂存起来,具体命令有:
git stash:暂存当前分支下的没有commit的代码;
git stash list:查看暂存区记录;
git stash apply:还原暂存区记录(最近一条);
git stash drop:删除暂存区记录(最近一条);
git stash pop:=git stash apply+git stash drop;
git stash clear:清除缓存区所有记录;
git merge & git rebase:
解决冲突:
git 分支:常用命令如下: