git中几天前漫不经心的使用了git checkout ver_hash的命令,结果push到远程库都提示everything is up-to-date,实际神马都没提交上去啊!但看本地log中的确有更新哦!后来用再做git st命令时发现老有一行红字: HEAD detached from 548a7fa 研究了一下发现当前貌似生成了一个临时的br: * (detached from 548a7fa) b7451ea v0.8 重新导入了真实的题库 master
一.git checkout //查看当前分支$ git branch master *t2 testing //checkout会覆盖当前工作区文件和覆盖暂存区内容,所以发现分支有未提交的警告,执行git checkout master -f,强制切换后分支没提交的修改会掉失.$ git checkout master error: Your local changes to the following files would be overwritten by checkout: team/
1. checkout one branch, show status user@vbox:/mnt/tmp$ git checkout masterSwitched to branch 'master'user@vbox:/mnt/tmp$ git status# On branch master# Changes not staged for commit:# (use "git add <file>..." to update what will be commi