一台电脑多个git使用 push 时候出现denied
http://my.oschina.net/silentboy/blog/220158
当一台电脑上多个git account 的时候, 出现如下问题,
$ git push origin master
ERROR: Permission to UserA/touchme.git denied to UserB.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
解决方式
http://www.jianshu.com/p/886aea2fa206
1: 取消git config --global 的 user, email 配置, 进入单独项目 单独配置
2: 删除默认的密钥, 重建新的密钥给冲突的account
3: 添加新密钥到config 文件
Host github_personal
HostName github.com
User UserA
IdentityFile ~/.ssh/id_personal_rsa
IdentitiesOnly yes
Host github_company
HostName github.com
User UserB
IdentityFile ~/.ssh/id_company_rsa
IdentitiesOnly yes
如果之后仍然出现验证问题如下:
$ git push origin master
Warning: Permanently added the RSA host key for IP address '192.30.252.122' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
解决办法: 重置repo 的url 为alias下的url
http://stackoverflow.com/questions/26953071/github-authentication-failed-github-does-not-provide-shell-access
参考如下:
git remote set-url origin git@${alias in config}:UserA/touchme.git
这样就可以正常push 了
$ git push origin master
Counting objects: 2, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 363 bytes | 0 bytes/s, done.
Total 2 (delta 1), reused 0 (delta 0)
验证添加的密钥能否成功连接github:
$ ssh -vT git@${alias}
一台电脑多个git使用 push 时候出现denied的更多相关文章
- 一台电脑上的git同时使用两个github账户
需求: 公司有github账号,自己有github账号,想在git上同时使用,两者互不干扰. 思路: 管理两个SHH key. 解决方案: 一.生成两个SSH key 为了举例方便,这里使用“one” ...
- [转]一台电脑上的git同时使用两个github账户
需求: 公司有github账号,自己有github账号,想在git上同时使用,两者互不干扰. 思路: 管理两个SHH key. 解决方案: 一.生成两个SSH key 为了举例方便,这里使用“one” ...
- 一台电脑同时添加git和bitbucket两个网站的ssh key
添加第一个ssh key 就不多说了,不懂的可以自己查资料 ssh-keygen -t rsa -C 'email_1@email.com' 然后一路enter就好了 假设已经添加好了git的ssh ...
- git提交时报错 permission denied
git push 时报错:permission denied xxx 目前很多解决办法是生成公钥和秘钥,这种方法安全可靠,比较适用于一台电脑对应一个git账户,但是多个账户在同一台电脑上提交使用git ...
- git同时存在两个账号(在同一台电脑上)——三步完成
目录 1.首先是常规设置 2.同时添加两个账号 3.最后一步,配置~/.ssh/config文件 4.补充:有时因为设置了全局账号,因此需要清除 由于本人有连个git账号,个人github账号和公司g ...
- Git学习笔记——从一台电脑上传文件到Github上
目标:从一台电脑上传文件到Github上 前提: 1.这里假定已在Github上创建了仓库,建立了仓库 2.已在这台电脑上安装了Git客户端 实验环境: 1.Windows 10 64位,已安装了Gi ...
- 简易搭建git仓库、关联远程和本地仓库方法。克隆仓库方法。同一台电脑上创建两个git ssh key方法。
一,在github上建仓库 react-js-antd-demo: 二:将远程仓库与本地仓库关联 git remote add origin git@github.com:begin256/react ...
- (转)windows一台电脑添加多个git账号
版权声明:技术总结来自互联网,书籍,以及工作积累.如果觉得我的总结有帮助,欢迎分享. https://blog.csdn.net/qq1332479771/article/details/701496 ...
- Git之同一台电脑如何连接多个远程仓库
Git之同一台电脑如何连接多个远程仓库 一.总结 一句话总结: 1.git使用.git目录里面的内容(ssh或用户名密码)来自动和远程仓库通信 2.在不同的仓库中配置不同的.git目录,可以连接不同的 ...
随机推荐
- [转帖]又一国产x86处理器可大规模上市:Intel至强核心 安全监测管控
又一国产x86处理器可大规模上市:Intel至强核心 安全监测管控 https://www.cnbeta.com/articles/tech/850525.htm 不知道是不是有一起汉芯事件 国产CP ...
- pip找不到的安装包
pip install找不到一些python包 可以访问网址,选择python版本自行下载:http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml 清华大学开源 ...
- 使用electron实现百度网盘悬浮窗口功能!
相关依赖 里面使用了vuex vue vue-route storeJs storeJs 用来持久化vuex状态 展示 介绍说明 没有使用electron内置的-webkit-app-region: ...
- 【算法入门】深度优先搜索(DFS)
深度优先搜索(DFS) [算法入门] 1.前言深度优先搜索(缩写DFS)有点类似广度优先搜索,也是对一个连通图进行遍历的算法.它的思想是从一个顶点V0开始,沿着一条路一直走到底,如果发现不能到达目标解 ...
- linux安装mysql8(完整图文笔记)
基本命令 安装 : yum install mysql-community-server 启动 : service mysqld start/restart 停止 : service mysqld s ...
- Paper Reading_Database
最近(以及预感接下来的一年)会读很多很多的paper......不如开个帖子记录一下读paper心得 AI+DB A. Pavlo et al., Self-Driving Database Engi ...
- jQuery之排他思想
使用的方法:click() css() siblings() <button>快速</button> <button>快速</button> ...
- Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” a...
报错: 从错误信息来看,似乎需要通过管理员身份来接受许可协议,于是试着从这个角度google,终于在这里找到了解决方法: 1.打开终端,输入 sudo xcodebuild -license 2.终 ...
- linux 建立 MySQL 账号
以 root 身份登录 Linux 系统,创建 mysql 组和用户 [root@Nagios-Server ~]# groupadd mysql [root@Nagios-Server ~]# us ...
- 开发板安装google浏览器
source.list中含有https 所以在更换源之前安装 apt-get install apt-transport-https 然后更换为中科大的源貌似不行 deb https://mirror ...