将本地的一个新项目上传到GitHub上新建的仓库中去

转载:

如何将本地的一个新项目上传到GitHub上新建的仓库中去

踩过的坑:

1.在git push时报错 error: RPC failed; curl 56 SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054

解决方案:查了很多原因,最后才知道是因为github在内网的情况下网速会很慢,加了FQ软件成功了

2.在git commit 的时候提示 

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

然后报错 error: invalid key:

解决方案:这是一个乌龙面 :我写成了git config you@example.com "you@example.com" 生无可恋 ..........

注:加上--global表示所有的项目的用户名都是一样的,如果只是单个的配置去掉--global即可

3. git push时报错fatal: Couldn't find remote ref master

解决方案:这个是因为没有commit或者是commit没有成功

4. 连续两次git remote add origin https://github.com/username/projectname.git 报错 fatal: remote origin already exists.

解决方案:git remote -v 查看是否成功,如果不成功删除掉重新来一次

git remote -v
git remote add origin  https://github.com/username/projectname.git

 

posted @ 2018-07-12 15:29  珍真小心  阅读(639)  评论(1编辑  收藏  举报