GIT常见问题及其解决方案

问题:

remote: Permission to beijing01/learn_github.git denied to liuhongyang02. fatal: unable to access ‘https://github.com/beijing01/learn_github.git/‘: The requested URL returned error: 403

To see what your remotes are you can run:

git remote -v

产生故障的原因是本地密钥和github上不同 解决方法:

Checking for existing SSH keys
  • Open Terminal.
  • enter ls -al ~/.ssh to see if existing SSH keys are present
  • Check the directory listing to see if you already have a public SSH key.

If you don‘t have an existing public and private key pair, or don‘t wish to use any that are available to connect to GitHub, then generate a new SSH key.

If you see an existing public and private key pair listed (for example id_rsa.pub and id_rsa) that you would like to use to connect to GitHub, you can add your SSH key to the ssh-agent.

Generating a new SSH key and adding it to the ssh-agent

Open Terminal. Paste the text below, substituting in your GitHub email address.

This creates a new ssh key, using the provided email as a label.

When you‘re prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.

At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".

Adding your SSH key to the ssh-agent

Start the ssh-agent in the background.

If you‘re using macOS Sierra 10.12.2 or later, you will need to modify your ~/.ssh/config file to automatically load keys into the ssh-agent and store passphrases in your keychain.

Add your SSH private key to the ssh-agent and store your passphrase in the keychain. If you created your key with a different name, or if you are adding an existing key that has a different name, replace id_rsa in the command with the name of your private key file.

Adding a new SSH key to your GitHub account

Copy the SSH key to your clipboard. If your SSH key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don‘t add any newlines or whitespace.

问题: 错误提示:fatal: remote origin already exists.

原文地址:https://www.cnblogs.com/zhichun/p/11368387.html

时间: 2025-01-11 14:57:07

GIT常见问题及其解决方案的相关文章

【git常见问题】fatal: Not a valid object name: 'master'.

创建本地分支:git branch dev 报错:fatal: Not a valid object name: 'master'. 原因: 问题描述-一个非法的master,原因:本地还没有创建master,你可以执行以下git branch,会发现没有看到本地分支列表 解决方案: 如果本地没有文件,添加一个文件 此时本地仓库主干master 创建成功,使用git branch 查看本地分支列表,会查看到如下图所示 可以创建本地分支: git branch dev 参考原文: http://s

NHibernate的常见问题及解决方案

问题1 : 异常:in expected: <end-of-text> (possibly an invalid or unmapped class name was used in the query) [from Customer] 解决方案:查看HQL语句查询的是否是实体类,映射文件属性是否正确:复制到输出目录à始终复制 ..生成操作à嵌入的资源. 问题2: 异常:缺少必需的属性“name”. 解决方案:查看映射文件里,是否哪个<property>节点缺少name属性 问题3

Git 常见问题与小知识

Git 常见问题     1.当有冲突时         如果一份代码有多人进行操作,那么也许会有冲突的时候,当有冲突时,<<<<<<< 七个小于号和=======七个等于号之间是当前开发者的代码 =======七个等于号和>>>>>>>七个大于号之间是其他开发者的代码,手动删除特殊符号及不需要的代码,完成merge工作,之后再执行git add -u命令把 解决好冲突的文件添加到暂存区,执行git commit 和git

NTP常见问题和解决方案&配置文件详解

一.命令:NTP.ntpq.ntpdate ntpd.ntpq.ntpdate1.ntpq -np //输出参数说明    -n:不显示域名#ntpq -np     remote           refid      st t when poll reach   delay   offset  jitter============================================================================== 127.127.1.0   

《PDF.NE数据框架常见问题及解决方案-初》

1.新增数据库后,获取标识列的值: 解决方案:    PDF.NET数据框架,已经为我们考略了很多,因为用PDF.NET进行数据的添加操作时,一般我们会传递Model实体进去,             在进行数据库的新增操作时,执行成功后,新增记录的标示又会赋值给传递的实体,例如: ///<summary>             ///添加一体记录             /// <param name="model">实体</param>    

[转]Linux下使用JNI的常见问题及解决方案

Linux下使用JNI的常见问题及解决方案 转载地址:http://www.cnblogs.com/javawebsoa/p/3220069.html 我碰到的问题是bad value 参考这里解决的 linux生成动态库时遇到了relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC错误. 由于我的系统是AMD64位的,所以需要在编译的时候

[git常见问题]error: src refspec matches more than one.

今天加班试图push代码的时候,报出了如下错误: 出现这个错误之前,是在远程服务器上创建了一个tag v2.1.1,同时clone的服务器代码指定的分支也是branch v2.1.1,本地用git tag命令可以查看分支: 在本地删除多余的tag标签: 再次push, Everything thing is OK! [git常见问题]error: src refspec matches more than one.

Android Studio使用过程中常见问题及解决方案

熟悉Android的童鞋应该对Android Studio都不陌生.Android编程有两个常用的开发环境,分别是Android Studio和Eclipse,之前使用比较多的是Eclipse,而现在呢,由于Android Studio的优越性,越来越多的人转而使用它了. 随着Android Studio使用人数的增加,使用过程中的问题也日益凸显,本文小编就整理了一些Windows系统下使用Android Studio的常见问题及解决方案,大家可以围观围观,遇到类似问题,不妨可以试试小编下面分享

repo sync出现“fatal: &#39;../platform/abi/cpp.git&#39; does not appear to be a git repository”的解决方案

在我下载Android源代码时,在最后一步调用repo sync,出现“fatal: '../platform/abi/cpp.git' does not appear to be a git repository”,后来在网上查了资料,参考http://zxquiet.iteye.com/blog/1470991和http://bbs.csdn.net/topics/380254094. 1.在存放android系统源代码的目录(也就是执行repo sync命令的目录)下,有个.repo的隐藏