跟我一起用Git
2015-10-03 13:29
344 查看
写这篇博文的原因
写这篇博文,是因为自己在使用Git的过程中,着实遇到了很多问题,现在记录下来,一是为了避免以后犯同样的错误,二是给其他人一些参考。使用TortoiseGit
1.在有一次使用TortioseGit的过程中,我遇到了这样的问题:Username for ‘https://github.com‘: dummymare
Password for ‘https://dummymare@github.com‘:
To https://github.com/dummymare/Hello-World.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to ‘https://github.com/dummymare/Hello-World.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.
出现这种情况,一般是因为:本地版本和主干上的有差异。。。让你先pull远端的版本,解决了冲突才能push。比如说,当时我的情况是,在Github新建了一个代码库,同时初始化了一个README.MD,建好之后,我马上就从本地Push代码,就出现了这个问题。我的解决办法是,pull远端的README.MD,然后再Push,就没有问题了:
相关文章推荐
- HDOJ 5479 Scaena Felix
- java中内部方法对外部类变量的引用
- [LeetCode]4Sum
- UVA - 1587 Box
- 04_工具类
- Navigation自定义
- Spring Security 4.0 CAS实现单点登录
- Android Material Design:CoordinatorLayout与NestedScrollView
- pip install遇到编码问题
- HDU 1076 An Easy Task(水~)
- 配置ubuntu和目标板nfs共享
- @Repository @Resource
- android 多媒体数据库详解
- SuiShenJi项目_dialog to Activity动画
- 算法----数组的排序(冒泡 选择 插入)
- 享元模式
- PAT1011 A+B和C (15)
- Swift 2.0 之map 与 zip
- deepin配置root登入
- Ftp上传下载 C#