码迷,mamicode.com
首页 > 其他好文 > 详细

git学习笔记(四)

时间:2014-12-11 17:09:18      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:blog   http   io   ar   os   sp   for   java   on   

http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/0013752340242354807e192f02a44359908df8a5643103a000

 

本地和远程github 相关联

现在本地新建一个git仓库

git init

与远程相关联

git remote add origin XXX.git

推送本地文件到远程

git push -u origin master

这边出现的 一个问题

To https://github.com/HelloKing/Professional-JavaScript-3.git
! [rejected]        master -> master (fetch first)
error: failed to push some refs to ‘https://github.com/HelloKing/Professional-Ja
vaScript-3.git‘
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., ‘git pull ...‘) before pushing again.
hint: See the ‘Note about fast-forwards‘ in ‘git push --help‘ for details.

原因是在github上新建项目时候加了个read.me文件,远程仓库存在本地仓库不存在的文件,所以需要进行整合远程变更

http://blog.csdn.net/ispeller/article/details/22183961

 

解决方案

git pull origin master (git pull)指令学习

git commit file

然后进行push

git push -u origin master

git学习笔记(四)

标签:blog   http   io   ar   os   sp   for   java   on   

原文地址:http://www.cnblogs.com/KingsWang/p/4157998.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!