
精通Git
spur_man
这个作者很懒,什么都没留下…
展开
-
git push时报错
在git分支上,由于手贱,执行了一次git reset HEAD^操作,然后重新git add file, commit -m “test” ,git pull ,之后git push origin branchName 时报错 error: failed to push some refs to To prevent you from losing history, non-fast-f...原创 2018-03-06 20:19:37 · 322 阅读 · 0 评论 -
2.4 撤销操作
有一种常见的撤销操作使用场景: 1 、提交后忘记了添加某些文件 2、提交后写错了提交信息 这个时候,如果想重新尝试提交,可以使用–amend选项: $ git commit --amend 上述命令会提交暂存区的内容。 举一个例子: $ git commit -m "initial commit" $ git add forgotten_file $ git co...转载 2018-03-02 19:17:06 · 467 阅读 · 0 评论