git问题小结

来源:互联网 发布:注册.hk域名 编辑:程序博客网 时间:2024/05/18 01:32

1.

fatal: destination path '2048game' already exists and is not an empty directory.

这个问题纯属自己脑残,因为是初学嘛,没有搞清每个指令是干嘛的,就干脆照着做。这个是把远程的代码拷贝到本地仓库的指令,本地仓库所在的文件夹不为空,所以就报错了。
2.

error: failed to push some refs to 'https://github.com/XXX/2048game.git'hint: Updates were rejected because the remote contains work that you dohint: not have locally. This is usually caused by another repository pushinghint: to the same ref. You may want to first integrate the remote changeshint: (e.g., 'git pull ...') before pushing again.hint: See the 'Note about fast-forwards' in 'git push --help' for details.

这个的原因是在github上新建了一个README文件,于是本地的repository就不是最新的了。需要做的就是先git pull origin master合并一下文件,具体的可以参考:https://www.douban.com/note/332510501/

0 0