Git clone 获取代码 Git pull 更新服务器的代码到本地 git reset --hard HEAD/具体版本号 本地改动不做任何保存的恢复
如果当前正工作在 (no branch)上: $ git checkout -b working,就会把(no branch)上的东西checkout到working分支 如果不小心从(no branch)branch切换到其他分支了,用git log不能查找到(no branch)的信息,不要担心,先用gitreflog查到(no branch)的commit,然后: $ git checkout -b backup commit
- Git push,merge,pull,fetch,rebase各自在什么情况下使用
出现error: The following untracked working tree files would beoverwritten by checkout: 时可以用 Git clean -d -fx来解决
如果git pull的时候不想因为自己的更改而产生冲突,可以执行如下命令 gitstash gitpull gitstash pop
如何提交代码? git stage 文件名 git commit -m "提交注释" git push origin 远程分支
|