美文网首页
git相关的知识

git相关的知识

作者: 未来的路就在那 | 来源:发表于2017-06-11 12:42 被阅读16次

1,上传代码到github上

1. git init
2. git add .
3. git commit -am "###"      -------以上3步只是本地提交
4.git remote add origin [git@xx.xx.xx.xx:repos/xxx/xxx/xxx.git]
5.git push origin 本地分支:远程分支(git push -u origin master)
###出现的问题1:(解决方案,输入git pull --rebase origin master,出现错误的原因是git服务器中的README.md文件不在本地代码目录中,可以通过如下命令进行代码合并,执行这句代码就可以使本地和git服务器同步了)
192:masonryDemoGitub macbook$ git push -u origin master
To https://github.com/chenwei007/CWMasonryDemo.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/chenwei007/CWMasonryDemo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

2,Cornerstone提交Cocoapods文件简单方法http://www.jianshu.com/p/47b41cdf6bf8

相关文章

网友评论

      本文标题:git相关的知识

      本文链接:https://www.haomeiwen.com/subject/gxehqxtx.html