git error
一,今天在上传代码时出错:
$ git push -u origin master
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/freemao/Genotype-corrector.git/info/refs
fatal: HTTP request failed
解决办法:
$ git remote set-url origin https://freemao:freemao1234@github.com/freemao/Genotype-corrector.git
之前的url是:https://github.com/freemao/Genotype-corrector.git
相当于添加一下用户名和密码
git remote set-url 相当于是修改了配置文件.git/config 中的url
修改过以后,成功提交。
如果url中不添加密码,只添加用户名,可能会报下面错误:
(gnome-ssh-askpass:52175): Gtk-WARNING **: cannot open display:
二,我先修改了一个文件,然后将他重命名,在github上将原来的那个文件给删了。接下来我再push就报错了:
$ git push -u origin master
To https://freemao:freemao1234@github.com/freemao/Genotype-corrector.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://freemao:freemao1234@github.com/freemao/Genotype-corrector.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
fast-forwards' section of 'git push --help' for details.
解决办法:
先pull一下:
$ git pull -f --all
Fetching origin
remote: Counting objects: 2, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 2 (delta 1), reused 2 (delta 1), pack-reused 0
Unpacking objects: 100% (2/2), done.
From https://github.com/freemao/Genotype-corrector
e94b6ee..960d781 master -> origin/master
Merge made by recursive.
再push:
$ git push -u origin master
OK了。
正确的改名字的方法:
先mv
然后 git add newname
git commit
git push
这个时候新文件被push了。但是老文件还在github上
接下来
git rm oldname
git commit
git push 这样就把老名字的文件在github上删除了
by freemao
FAFU
git error的更多相关文章
- Git error on commit after merge - fatal: cannot do a partial commit during a merge
Git error on commit after merge - fatal: cannot do a partial commit during a merge this answer is : ...
- git: error while loading shared libraries: libiconv.so.2
git安装之后出现:git: error while loading shared libraries: libiconv.so.2: cannot open shared object file: ...
- [git] git error: unable to unlink old
今天git pull ,结果报错 : git error: unable to unlink old 原因是 文件夹内 一个exe 处于打开状态. 哈哈哈哈,又是个低级错误~~~ 下次注意呀~
- git error: unable to create file Invalid argument
git error: unable to create file xxxx Invalid argument 原因: mac 上创建的文件名里有冒号,这在windows 上是不允许的. 解决方式: ...
- git error: unable to rewind rpc post data - try increasing http.postBuffer
error: unable to rewind rpc post data - try increasing http.postBuffererror: RPC failed; curl 56 Rec ...
- 使用git error: RPC failed; result=22, HTTP code = 411
使用git提交比较大的文件的时候可能会出现这个错误 error: RPC failed; result=22, HTTP code = 411 fatal: The remote end hung u ...
- git error: Your local changes to the following files would be overwritten by merge:xxxxxx ,Please commit your changes or stash them before you merge.的phpstorm解决办法
git报错 error: Your local changes to the following files would be overwritten by merge: .idea/encoding ...
- 【Git】git error记录之 "unpacking the sent packfile failed on the remote"
错误信息: error: cannot open .git/FETCH_HEAD: Permission denied unpacking the sent packfile failed on th ...
- git error: RPC failed; curl 56 GnuTLS recv error 解决方案
// git 报错情况: error: RPC failed; curl 56 GnuTLS recv error (-110): The TLS connection was non-properl ...
随机推荐
- UVa 12299 RMQ with Shifts(移位RMQ)
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: "Times New ...
- 使用nodewebx进行前后端开发环境分离
下载nodewebx(windows环境) npm install nodewebx npm install inherits 为什么要下载inherits,因为nodewebx依赖它... 构建目录 ...
- 《BI那点儿事》数据流转换——OLE DB 命令转换
OLE DB命令对数据流中的数据行执行一个OLE DB命令.它针对数据表中的每一行进行更新操作,可以事先将要更新的数据存放在表中.或者针对一个有输入参数的存储过程,可以将这些参数存放在一个数据表中,不 ...
- HDU-4528 小明系列故事——捉迷藏 BFS模拟
题意:链接 分析:每一个D或者是E点往四面延伸,并且赋一个特殊的值,能看到D点的点赋值为1,能看到E点的点赋值为1000,这是因为最多100步,因此最后可以根据除以1000和对1000取模来得出某个状 ...
- jquery 判断元素是否隐藏
$(select).is(":hidden") 返回 true/false
- Lambert漫反射.BLinnPhong及Phong模型 Unity自带的在Lighting.cginc里
1.漫反射 此模型属于经验模型,主要用来简单模拟粗糙物体表面的光照现象 此模型假设物体表面为理想漫反射体(也就是只产生漫反射现象,也成为Lambert反射体),同时,场景中存在两种光,一种为环境光,一 ...
- 用sqlplus为oracle创建用户和表空间<转>
用Oracle10g自带的企业管理器或PL/SQL图形化的方法创建表空间和用户以及分配权限是相对比较简单的,本文要介绍的是另一种方法,使用Oracle 9i所带的命令行工具:SQLPLUS来创建表空间 ...
- android 5.0 水波纹 实现
1. 定义一个普通圆角背景的xml; rounded_corners.xml <?xml version="1.0" encoding="utf-8"?& ...
- Circular progress bar in Unity 3D
Circular progress bar in Unity 3D - UnityScripthttp://stackoverflow.com/questions/22662706/circular- ...
- 将Python脚本封装成exe可执行文件 转
将Python脚本封装成exe可执行文件 http://www.cnblogs.com/renzo/archive/2012/01/01/2309260.html cx_freeze是用来将 Pyt ...