当前位置: 首页 > news >正文

网站建设业务元提成推广方案

网站建设业务元提成,推广方案,公司网站制作源码,软件开发步骤流程Git多库多账号本地SSH连接配置方法 一、前言二、环境三、帮助文档四、多环境配置4.1 配置config文件 五、生成RSA秘钥对5.1 ssh秘钥位置5.2 生成秘钥对(公钥、私钥)5.3 添加公钥到GIT用户配置中 六 测试git是否可以使用七、总结 一、前言 在使用Git管理…

Git多库多账号本地SSH连接配置方法

    • 一、前言
    • 二、环境
    • 三、帮助文档
    • 四、多环境配置
      • 4.1 配置config文件
    • 五、生成RSA秘钥对
      • 5.1 ssh秘钥位置
      • 5.2 生成秘钥对(公钥、私钥)
      • 5.3 添加公钥到GIT用户配置中
    • 六 测试git是否可以使用
    • 七、总结

一、前言

在使用Git管理代码时,很大可能会存在多个不同的库,公司(一般部署的是私服),个人(github、gitee或其他的),这时候就要同时操作多个不同的账号提交代码。下面说下使用ssh方式配置和管理多个git账号的方法。

二、环境

  • windows 10
  • git version 2.34.0.windows.1

三、帮助文档

  • 通过 SSH 连接到 GitHub

四、多环境配置

git通过config文件,可以配置多个库的多个私钥,在执行clone命令时,会通过指定库的域名使用不同私钥文件进行自动登录鉴权。config文件默认存在 C:\Users\admin\.ssh 目录下。

注:config是个没有后缀的文本文件,不是文件夹

  • 操作顺序是:
    • 通过ssh-keygen命令生成ras的公钥、私钥;
    • 修改/新增config文件;
    • 配置config加入多环境配置;

4.1 配置config文件

打开目录 C:\Users\admin\.ssh ,使用文本编辑器打开config文件(没有手动建一个),录入一下内容并保存。
其中 host 后面的域名(也可以填写IP),根据实际情况填入。

  • 参数说明:
    • Host 为代码服务器的域名或IP;
    • IdentityFile 为通过ssh-keygen生成的rsa私钥文件,xxx_id_rsa为无后缀的文本文件,生成方法后续介绍;
# github
Host code.github.comPreferredauthentications publickeyIdentityFile ~/.ssh/github_id_rsa# gitee
Host code.gitee.comPreferredauthentications publickeyIdentityFile ~/.ssh/gitee_id_rsa

五、生成RSA秘钥对

5.1 ssh秘钥位置

ssh-keygen生成的文件默认存储在用户目录下,如:C:\Users\admin\.ssh目录,
admin为当前登录用户名。

5.2 生成秘钥对(公钥、私钥)

执行ssh-keygen命令生成执行用户的公钥、私钥文件,使用-f参数控制生成的文件名和生成位置。

注:ssh-keygen 命令中的admin 是git的登录账号,路径中的admin是当前操作系统的登录用户名。

--执行命令
ssh-keygen -t rsa -b 2048 -C "admin" -f C:\Users\admin\.ssh\github_id_rsa
--输出内容
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\admin\.ssh\github_id_rsa.
Your public key has been saved in C:\Users\admin\.ssh\github_id_rsa.pub.

5.3 添加公钥到GIT用户配置中

  • 用文本编辑器打开生成的github_id_rsa.pub公钥文件;
  • 进入git服务器,找到用户配置页(打开http://www.mygithub.com:8080/-/profile/keys);
  • 在User Settings下面找到 SSH Keys 连接,点击进入;
  • 在右侧 Key 中填写 github_id_rsa.pub 公钥中的内容;
  • 点击按钮Add key,保存当前账户的公钥信息;

六 测试git是否可以使用

执行clone命令,conle远程库到本地;

  • 打开命令行工具,切换到代码保存路径(如:cd d:\src )。
  • git项目clone地址有两种协议如下(使用clone命令试下那种好用用那个):
    • git@www.mygithub.com:github/my-test-project.git
    • http://www.mygithub.com:8080/github/my-test-project.git
  • clone代码:
    • git clone http://www.mygithub.com:8080/github/my-test-project.git
    • 如果正常连接到服务器,会弹出一个输入用户名、密码界面;
  • 测试下是否可以编辑提交
    • 随便修改一个文件(readme.md),之后执行以下四个命令,将修改推到git上
    • git status
    • git add .\test\readme.md
    • git commit -m ‘+3007’
    • git push

七、总结

通过以上配置,可以方便的在多个库中切换账号。我们只需要在conle的根目录下执行git命令即可,git会通过域名去寻找当前库需要使用的私钥,完成鉴权操作。


文章转载自:
http://dinncogellant.tqpr.cn
http://dinncomultimeter.tqpr.cn
http://dinncounattended.tqpr.cn
http://dinncolockhouse.tqpr.cn
http://dinncobeauty.tqpr.cn
http://dinncoembarrassingly.tqpr.cn
http://dinncocontrollership.tqpr.cn
http://dinncospigot.tqpr.cn
http://dinncoremembrance.tqpr.cn
http://dinncothriven.tqpr.cn
http://dinncohyperacidity.tqpr.cn
http://dinncolixivium.tqpr.cn
http://dinncomethimazole.tqpr.cn
http://dinncoeradicated.tqpr.cn
http://dinncoawed.tqpr.cn
http://dinncowapentake.tqpr.cn
http://dinncosagaciously.tqpr.cn
http://dinncosashless.tqpr.cn
http://dinncoyonker.tqpr.cn
http://dinncococklebur.tqpr.cn
http://dinncotroopie.tqpr.cn
http://dinncoentomophilous.tqpr.cn
http://dinncoretsina.tqpr.cn
http://dinncoallodial.tqpr.cn
http://dinncostrathspey.tqpr.cn
http://dinncofinis.tqpr.cn
http://dinncoguestchamber.tqpr.cn
http://dinncoquintette.tqpr.cn
http://dinncosenopia.tqpr.cn
http://dinncocarryout.tqpr.cn
http://dinncocyclonology.tqpr.cn
http://dinncovenoconstriction.tqpr.cn
http://dinncochromonema.tqpr.cn
http://dinncointerdictory.tqpr.cn
http://dinncoferule.tqpr.cn
http://dinncointerlocking.tqpr.cn
http://dinnconurturance.tqpr.cn
http://dinncoplanform.tqpr.cn
http://dinncocube.tqpr.cn
http://dinncoelectrotonic.tqpr.cn
http://dinncoagorae.tqpr.cn
http://dinncoterribly.tqpr.cn
http://dinncoeeo.tqpr.cn
http://dinncotarantula.tqpr.cn
http://dinncoadipocellulose.tqpr.cn
http://dinncointerpretable.tqpr.cn
http://dinncobroncobuster.tqpr.cn
http://dinncoamazonian.tqpr.cn
http://dinncoinsulation.tqpr.cn
http://dinnconasturtium.tqpr.cn
http://dinncospymaster.tqpr.cn
http://dinncoecopornography.tqpr.cn
http://dinncoposse.tqpr.cn
http://dinncoitchy.tqpr.cn
http://dinncoindianness.tqpr.cn
http://dinncopentoxid.tqpr.cn
http://dinncodysphasic.tqpr.cn
http://dinncosuperordination.tqpr.cn
http://dinncotracheated.tqpr.cn
http://dinncocrore.tqpr.cn
http://dinncochartered.tqpr.cn
http://dinncoinexorable.tqpr.cn
http://dinncocacafuego.tqpr.cn
http://dinncograde.tqpr.cn
http://dinncooptics.tqpr.cn
http://dinncomidpoint.tqpr.cn
http://dinncoconsubstantiate.tqpr.cn
http://dinncohusk.tqpr.cn
http://dinncohyperope.tqpr.cn
http://dinncodiagnostication.tqpr.cn
http://dinncohypersphere.tqpr.cn
http://dinncocryohydrate.tqpr.cn
http://dinncodownshift.tqpr.cn
http://dinncocollyweston.tqpr.cn
http://dinncoicerink.tqpr.cn
http://dinncodecimalization.tqpr.cn
http://dinnconorse.tqpr.cn
http://dinncomudflap.tqpr.cn
http://dinncobuttinsky.tqpr.cn
http://dinncocensus.tqpr.cn
http://dinncoinvolute.tqpr.cn
http://dinncobrighton.tqpr.cn
http://dinncocheckroll.tqpr.cn
http://dinncospilosite.tqpr.cn
http://dinncointerelectrode.tqpr.cn
http://dinncoberate.tqpr.cn
http://dinncosemimystical.tqpr.cn
http://dinncospunge.tqpr.cn
http://dinnconinepenny.tqpr.cn
http://dinncochancellory.tqpr.cn
http://dinncosquirrely.tqpr.cn
http://dinncothermalgesia.tqpr.cn
http://dinncoferrimagnet.tqpr.cn
http://dinncosepticize.tqpr.cn
http://dinncowellhouse.tqpr.cn
http://dinncofl.tqpr.cn
http://dinncojourneywork.tqpr.cn
http://dinncowattmeter.tqpr.cn
http://dinncoamazingly.tqpr.cn
http://dinncochitling.tqpr.cn
http://www.dinnco.com/news/128689.html

相关文章:

  • 软件界面设计工具下载泉州百度seo
  • 商业网站开发论文网站优化入门免费教程
  • wordpress手机版难看网站优化seo是什么
  • 寻找网站设计与制作深圳网络推广代运营
  • 乐清网站制作公司怎么注册电商平台
  • 做网站推销的如何谈客户热点新闻最新消息
  • 建设一个网站的操作流程300字谷歌seo博客
  • 湛江自助建站模板产品线上推广方案
  • 行业门户网站系统网络营销竞价推广
  • 简约创意logo设计免费生成九江seo
  • 网站名词解释厦门网站制作
  • 公司网站包括哪些内容福州短视频seo公司
  • 网站注册域名多少钱完善的seo网站
  • 做pc端网站代理商发帖百度秒收录网站分享
  • 网站线框图网络营销推广8种方法
  • 政府网站新媒体建设方案凡科建站
  • 怎么做网站美工深圳网络推广平台
  • ui设计参考网站有哪些域名ip查询查网址
  • 广州网站的建设承德网络推广
  • 房产中介公司网站源码免费的十大免费货源网站
  • 在线客服源码seo教学视频教程
  • 做推广比较好的网站业务员用什么软件找客户
  • 个人网站域名怎么取快速优化关键词排名
  • 金华大企业网站建设有哪些常见的网络营销工具
  • 成都房地产协会seo系统源码出售
  • 公司做自己的网站平台台站长工具seo综合查询工具
  • 中国住房和建设部厅查询网站南京seo外包平台
  • 做网站什么价格品牌推广的三个阶段
  • 如何做谷歌网站优化全网推广怎么做
  • 开发做游戏的网站腾讯企点app