Git系列详细教程(四)Git连接GitHub相关操作
<h2 id="1创建github远程仓库">1、创建GitHub远程仓库</h2><p><img src="https://gitee.com/thirtyyy/img/raw/master/img/20210426153231.png" alt="image-20210426153230728" loading="lazy"></p>
<p><img src="https://gitee.com/thirtyyy/img/raw/master/img/20210426153345.png" alt="image-20210426153344734" loading="lazy"></p>
<h2 id="2远程仓库操作">2、远程仓库操作</h2>
<h3 id="21-创建远程仓库别名">2.1 创建远程仓库别名</h3>
<p><img src="https://gitee.com/thirtyyy/img/raw/master/img/20210426153632.png" alt="image-20210426153631589" loading="lazy"></p>
<p><img src="https://gitee.com/thirtyyy/img/raw/master/img/20210426153846.png" alt="image-20210426153844861" loading="lazy"></p>
<h3 id="22-推送本地分支到远程仓库">2.2 推送本地分支到远程仓库</h3>
<pre><code>git push 别名 分支
</code></pre>
<p><img src="https://gitee.com/thirtyyy/img/raw/master/img/20210426154406.png" alt="image-20210426154405519" loading="lazy"></p>
<p>此时发现已经成功上传到GitHub远程仓库</p>
<h3 id="23-克隆远程仓库到本地"><img src="https://gitee.com/thirtyyy/img/raw/master/img/20210426154511.png" alt="image-20210426154509705" loading="lazy">2.3 克隆远程仓库到本地</h3>
<pre><code>git clone 远程地址
</code></pre>
<p><img src="https://gitee.com/thirtyyy/img/raw/master/img/20210426154724.png" alt="image-20210426154723561" loading="lazy"></p>
<h3 id="24-配置ssh免密登录">2.4 配置SSH免密登录</h3>
<p>进入当前用户的家目录,删除.ssh目录(没有可以忽略删除)</p>
<p><img src="https://gitee.com/thirtyyy/img/raw/master/img/20210426162513.png" alt="image-20210426162512701" loading="lazy"></p>
<p>生成.ssh</p>
<p><img src="https://gitee.com/thirtyyy/img/raw/master/img/20210426162703.png" alt="image-20210426162702065" loading="lazy"></p>
<p>进入GitHub</p>
<img src="https://gitee.com/thirtyyy/img/raw/master/img/20210426162013.png" alt="image-20210426162011462" style="zoom: 80%">
<img src="https://gitee.com/thirtyyy/img/raw/master/img/20210426162154.png" alt="image-20210426162153384" style="zoom: 80%">
<img src="https://gitee.com/thirtyyy/img/raw/master/img/20210426162400.png" alt="image-20210426162400112" style="zoom: 80%">
<p>这样配置之后,再向远程仓库push的时候使用ssh连接就不需要输入用户名和密码登陆了</p><br><br>
来源:https://www.cnblogs.com/thirtyYu/p/14705309.html
頁:
[1]