git遇到的一点小问题
来源:互联网 发布:四维设计软件 编辑:程序博客网 时间:2024/05/24 06:25
今天使用androidstudio将做了一段时间的小项目上传到git。
在android studio中创建仓库,然后进入文件夹。命令行中
git remote add ###添加远程仓库
然后add
commit
push(如果忘了add commit直接push也是会报错的。)
然后
git push -u origin master
提示下面错误:
--ssh: Could not resolve hostname ssh.github.com: Name or service not known
我查看了一下配置。也没有什么问题。后来思考了一下,无法解析很有可能是dns解析的问题
看了一下我的dns原来是服务器课程设计时配置为固定的虚拟机dns解析 ip忘记改回来。
这边改为自动获取就可以了。
但是却又出现了新的报错:
error: failed to push some refs to 'git@git.oschina.net:ningbo1222/CollegeLife.g it'
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.
对于这个问题,很明显提示需要pull一下,
通过查询
可以通过如下命令进行代码合并【注:pull=fetch+merge]
git pull --rebase origin master
执行后在执行push,果然成功了。
- git遇到的一点小问题
- 遇到的关于ifstream::eof()的一点小问题
- 本人遇到的关于namespace的一点小问题总结
- 使用CodeIgniter的路径优化遇到的一点小问题
- eclipes发布到tomcat时遇到的一点小问题
- ubuntu 安装Tomcat时遇到的一点小问题
- 关于 VS2010 使用中遇到的一点小问题
- JDBC编程中遇到的一点小问题
- 虚拟机遇到的一点小问题,已经解决了
- 线索链表遇到的一点小问题
- 在Mac上开发wp遇到的一点小问题
- cocos中使用Control遇到的一点小问题
- 开发中遇到的一点小问题---写给自己
- 回到顶部 插件 遇到的一点小问题
- 刚开始玩openMP,总结一下遇到的一点小问题。
- 每日一记-Git使用中遇到的小问题
- 记录一下使用git遇到的一个小问题
- 删除git本地分支遇到的一个小问题
- bellman-ford算法模板
- 11.4
- 数据结构——队列的使用(二)
- 136. Single Number
- merchant story
- git遇到的一点小问题
- 活学活用,打开/重启Tomcat的小程序~
- 第一次写CSDN博客
- byte字节数组 转换成double类型
- 洛谷P1220 关路灯
- PHP集成环境 Xampp,PHPwamp等等国内外著名的集成环境
- python技巧(13)
- Java中JDBC操作MySQL数据库
- 187. Repeated DNA Sequences