在github上传项目遇到的问题(error: failed to push some refs to 'https://github.com/CrazyDony/text.git')
2016-07-21 17:17
826 查看
在命令行中输入:
echo "# text" >>README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/CrazyDony/text.git
git push -u origin master
会出现以下错误
error: failed to push some refs to 'https://github.com/CrazyDony/text.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中的README.md文件不在本地代码目录中,
命令行中输入:
git pull--rebase origin master
git push -u origin master
然后又会出现
error: failed to push some refs to 'https://github.com/CrazyDony/text.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and 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.
命令输入:
git push origin master
出现
failed to push some refs to 'https://github.com/CrazyDony/text.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.
原因:[b]自己分支版本低于主版本
[/b]
[b]git push -u origin master-f[/b]
Counting objects: 35, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (29/29), done.
Writing objects: 100% (35/35), 10.15 KiB | 0 bytes/s, done.
Total 35 (delta 5), reused 0 (delta 0)
To https://github.com/CrazyDony/text.git
+ aa70966...f64b22a master -> master (forced update)
Branch master set up to track remote branch master from origin. 完成.
相关文章推荐
- com.squareup.okhttp.Interceptor
- Windows Server 2012 虚拟化实战:网络(二)
- OKHttp使用详解及源码解析
- 浅析HTTP协议
- HTTP Header 详解
- MySQL 中NULL和空值的区别 (转载 http://blog.sina.com.cn/s/blog_3f2a82610102v4dn.html)
- Ajax那些事儿
- Mac本不用连接网线,模拟ipv6网络环境
- HTTP的通信的发送请求,接受请求响应包含哪些内容?OC中是怎样实现的?
- 计算机网络之网络基础
- 利用OpenCV读取大华网络摄像头
- HttpWebRequest介绍
- 云片网络创建java短信模块
- TCP连接的建立和释放(三次握手和四次握手)
- <meta http-equiv="X-UA-Compatible" content="IE=edge">的说明
- http://blog.csdn.net/luanlouis/article/details/41576373
- HttpGet和HttpPost的区别
- 双向长短时记忆循环神经网络详解(Bi-directional LSTM RNN)
- os htttp网络请求cookie的读取与写入(NSHTTPCookieStorage)
- 进行http通讯的开源库libcurl的应用过程