git无法同步

  • 出现问题: fatal: destination path 'test' already exists and is not an empty directory.

解决方法如下:

  1. git init
  2. git remote add origin https://xxx@xx.git(remote是存放在远程的一个计算机。在这里指GitHub服务器。 在绝大多数场合我们取origin这个名字指代远程的代码仓库(指的就是https://github.com/username/Hello-World.git),这样每次pull,fetch时都可以用origin来指代你要拉取或更新哪个代码仓库的文件了
  3. git fetch
  4. git branch master origin/master
  5. git checkout master

然后你就可以用 
git add . 
git commit -m “提交信息” 
git push origin master 
对你的代码进行提交上传了。

posted on 2017-09-07 20:06  李飞21  阅读(598)  评论(0编辑  收藏  举报