美文网首页
gitLab&github的一些问题处理

gitLab&github的一些问题处理

作者: kyson老师 | 来源:发表于2019-03-21 10:43 被阅读0次

概述

github以及gitlab是大部分开发者都在使用的仓库管理工具。笔者在使用的过程中收集了一些之前遇到的问题,并撰写了该文章,以后有更新的会不定期在文章后添加。

git clone无权限

拉取公司项目的仓库,发现拉取失败:

git clone git@git.corp.xxx.cn:ios/Evian.git
Cloning into 'Evian'...
git@git.corp.imdada.cn: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

通过如下几步解决该问题:
第一步:选中个人配置


第二步:选中SSH Keys,并输入SSH Key


那么 SSH Key怎么生成呢,可以通过如下命令:

ssh-keygen

笔者的操作流程如下:

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/kyson/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/kyson/.ssh/id_rsa.
Your public key has been saved in /Users/kyson/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:k/QfKoFlBR1tJiAnzd25kJPe2ES3soeUhGZOktQ41ow kyson@kysondeMacBook-Air.local
The key's randomart image is:
+---[RSA 2048]----+
|      o+=%oOo..  |
|       +E.^.Bo . |
|       .+O @+..  |
|       = o+.++   |
|      . S . + .  |
|         o o o   |
|        . . .    |
|         .       |
|                 |
+----[SHA256]-----+

git push无权限

remote: Permission to zjh171/GCDAsyncSocket.git denied to AngryLi.
fatal: unable to access 'https://github.com/zjh171/GCDAsyncSocket.git/': The requested URL returned error: 403

进入.git文件夹,找到config文件(.git文件夹是隐藏文件夹,位于当前项目的根目录下):

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = true
[remote "origin"]
    url = https://github.com/zjh171/GCDAsyncSocket.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master

中的

    url = https://github.com/zjh171/GCDAsyncSocket.git

修改为:

    url = https://zjh171@github.com/zjh171/GCDAsyncSocket.git

即可

Pushing to Git returning Error Code 403 fatal: HTTP request failed

Pushing to Git returning Error Code 403 fatal: HTTP request failed

解决方式:
Github seems only supports ssh way to read&write the repo, although https way also displayed 'Read&Write'.

So you need to change your repo config on your PC to ssh way:

  1. edit .git/config file under your repo directory
  2. find url=entry under section [remote "origin"]
  3. change it from url=https://MichaelDrogalis@github.com/derekerdmann/lunch_call.git to url=ssh://git@github.com/derekerdmann/lunch_call.git. that is, change all the texts before @ symbol to ssh://git
  4. Save config file and quit. now you could use git push origin master to sync your repo on GitHub

参考

Getting permission denied (public key) on gitlab

广告

我的首款个人开发的APP壁纸宝贝上线了,欢迎大家下载。

壁纸宝贝

相关文章

  • gitLab&github的一些问题处理

    概述 github以及gitlab是大部分开发者都在使用的仓库管理工具。笔者在使用的过程中收集了一些之前遇到的问题...

  • 一些问题处理记录

    目录 PathVariable annotation was empty on param 0 gradle bu...

  • 记一些问题处理

    Feign反序列化错误 起因:在导出excel的时候, 发现有的字段不能正常输出。 其中对应的字段是 cPremi...

  • android-6.0.1编译问题处理

    编译Android-6.0.1的过程中遇到的一些问题及处理方法: error: unsupported reloc...

  • 加班

    今天加班处理一些问题,周一大领导要review。 其实这些问题早已存在,只是要么难以处理,要么重视度不够,总之脱了...

  • iOS 效果处理(内阴影、外阴影、外发光、内发光、投影)

    iOS 效果处理(内阴影,外阴影,外发光,内发光,投影) 前言 最近在做效果处理,其中遇见了一些问题,写篇文章记录...

  • Java异常处理的一些问题

    六种异常处理的陋习 你觉得自己是一个Java专家吗?是否肯定自己已经全面掌握了Java的异常处理机制?在下面这段代...

  • CALayer-绪论(iOS论文系列)

    今天在处理一些问题的时候,又牵扯到了图层的处理,然后开始发掘大脑深处的记忆,不过,O(∩_∩)O~发现自己又忘的差...

  • 还有一些问题需处理

    一 如何调整 我不被无条件爱的认知,父亲果然的不心疼我 不爱我吗?弟弟果然不愿意帮助我吗? 二 如何有理智的不盲目...

  • 技能模块的防外挂机制和同步机制优化

    游戏在真实的环境中,有些特殊情况需要处理,本文介绍技能模块是如何处理人为作弊和现实中的网络导致的一些问题。 主要介...

网友评论

      本文标题:gitLab&github的一些问题处理

      本文链接:https://www.haomeiwen.com/subject/cjtqvqtx.html