一.问题 近期在使用git时遇到一个问题,就是在git上传文件时,将一个100兆的大文件添加到了git,并执行了push操作,这时在上传完毕后,会提示这个错误 Large files detected see http:git.io/iEPt8g for more information this is larger than GitHubs recommended maximum file size of 50MB 即git无法上传超过50M的单个文件. 如果未push,可通过git comm
Reseting remote to a certain commit Assuming that your branch is called master both here and remotely, and that your remote is called origin you could do: git reset --hard <commit-hash> git push -f origin master However, you should avoid doing this
git的撤销与回滚在平时使用中还是比较多的,比如说我们想将某个修改后的文件撤销到上一个版本,或者是想撤销某次多余的提交,都要用到git的撤销和回滚操作.撤销分两种情况,一个是commit之前,一个是commit之后,下面具体看下这两种情况. 一.git commit之前 未添加到暂存区的撤销(没有git add) 添加进暂存区的撤销(git add后) $ git status On branch test_git Changes not staged for commit: 没有添加到暂存区