git push 时报错:permission denied xxx

目前很多解决办法是生成公钥和秘钥,这种方法安全可靠,比较适用于一台电脑对应一个git账户,但是多个账户在同一台电脑上提交使用git时就容易出现公钥和秘钥不生效问题,本人就是不生效,但是各种谷歌终于还是找到了一个解决办法,今天记下来与大家共享,如有错误或不足,请赐教:

1、首先找到自己项目目录,在目录中有一个git文件夹(默认是隐藏的,需要ls -a 或 windows显示隐藏文件)

2、打开git文件夹(命令或直接磁盘找到打开均可)

3、找到config文件,记事本(不太建议此方式,windows记事本有可能出现编码改变问题)或sublime或notepad++或editplus打开config文件

4、修改url为当前要被提交的账号名下git的仓库地址

例如:当前地址为:http://github.com/xxxx/xxx.git 修改为  http://username@github.com/xxx/xxx.git (username是当前要提交到哪个账号下的用户名)

至此就可以解决a电脑上用b账户提交git permission denied xxx问题

但是如果项目比较多,以上方法比较不妥的地方是每个项目都需要改配置文件,还是早日研究好公钥和秘钥为妙!

git提交时报错 permission denied的更多相关文章

  1. Git push提交时报错Permission denied(publickey)...Please make sure you have the correct access rights and the repository exists.

    一.git push origin master 时出错 错误信息为: Permission denied(publickey). fatal: Could not read from remote ...

  2. git提交时报错处理办法

    git提交时报错:Updates were rejected because the tip of your current branch is behind: 有如下几种解决方法: 1.使用强制pu ...

  3. Visual Studio Code 使用 Git插件报错 - Permission denied (publickey)

    在使用GitHub的时候,为了避免每次输入用户名密码,都会使用SSH方式代替Https. 按网上教程,大多数使用SSH-KeyGen生成公私钥对,而后上传公钥至Github,并切换Repositori ...

  4. 使用git提交时报错:error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large

    Delta compression using up to 4 threads.Compressing objects: 100% (2364/2364), done.Writing objects: ...

  5. git提交时报错:Updates were rejected because the tip of your current branch is behind

    有如下3种解决方法: 1.使用强制push的方法:git push -u origin master -f这样会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候. 2.push前先将远程rep ...

  6. IDEA中使用git报错Permission denied (publickey)

    最近在使用idea开发时,使用git拉取远程仓库的代码时,报错Permission denied (publickey),原因是因为ssh的密钥失效,必须得重新设置下ssh的密钥即可. 命令很简单,在 ...

  7. git push时报错refusing to merge unrelated histories

    1. 删除本地项目中的.git目录,然后向远程仓库提交代码的时候,重新配置后再次提交.会有冲突. 解决方式: git remote add origin [//your giturl] git pul ...

  8. 解决方案 git@github.com出现Permission denied (publickey)

     ubentu 13.10 git version 1.8.3.2 解决方案:ssh -T git@github.com出现Permission denied (publickey).的问题 今天的任 ...

  9. java sftp 报错 Permission denied (没有权限;拒绝访问)

    解决办法: 1.检查账号密码是否错误 2.检查freeSSHD是否是以管理员身份运行的 3.检查sftp路劲有没有配置错误,java通过sftp将图片文件传输到指定文件夹,如果这个文件夹在配置的当前目 ...

随机推荐

  1. Spring RestTemplate GET 请求参数

    @Test public void testUpdateProfitJson_GET_Params() throws BusinessException { String apiURL="U ...

  2. HiveSQLException: Error while compiling statement: No privilege 'Create' found for outputs { database:default }

    今天用Hive的JDBC实例时出现了HiveSQLException: Error while compiling statement: No privilege 'Create' found for ...

  3. 封装一个帮助类来写文件到android外置存储器上

    项目地址:点击打开 项目简介:写文件到android外置存储器的一个帮助类,和它的demo程序 它是如何工作的呢? 1.创建 AppExternalFileWriter 对象并传递context(上下 ...

  4. JAVA中数组介绍

    一.数组: 数组指一组数据的集合,数组中的每个数据被称作元素. 二.数组定义: 数组类型[] 数组名 = new 数组类型[元素个数或数组长度]: (注意:等号前面的[]里面不能写任何东西) 也可以以 ...

  5. [转]linux远程登入不需要密码

    如何通过一台linux ssh远程其他linux服务器时,不要输入密码,可以自动登入.提高远程效率,不用记忆各台服务器的密码. 工具/原料   ssh,ssh-keygen,scp 方法/步骤     ...

  6. Neo4j-3.0.3 (Debian 8)

    平台: Ubuntu 类型: 虚拟机镜像 软件包: neo4j-3.0.3 basic software database graph database infrastructure neo4j op ...

  7. F5-WAF-12.0

    平台: CentOS 类型: 虚拟机镜像 软件包: f5bigip basic software security waf 服务优惠价: 按服务商许可协议 云服务器费用:查看费用 立即部署 产品详情 ...

  8. python 函数学习之sys.argv[1]

    一.sys 模块 sys是Python的一个「标准库」,也就是官方出的「模块」,是「System」的简写,封装了一些系统的信息和接口. 官方的文档参考:https://docs.python.org/ ...

  9. HDU4417 线段树 + 离线处理

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4417 , 线段树(或树状数组) + 离线处理 最近看了几道线段树的题都是需要离线处理数据的,正好这块比 ...

  10. pat甲级1012

    1012 The Best Rank (25)(25 分) To evaluate the performance of our first year CS majored students, we ...