欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程语言 > python >内容正文

python

CPython入门----Fork源码到自己github并下载配置本地git

发布时间:2024/3/24 python 31 豆豆
生活随笔 收集整理的这篇文章主要介绍了 CPython入门----Fork源码到自己github并下载配置本地git 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

更多信息请关注 个人网站

一、基础准备工作

(1)首先在github注册一个自己的账号
(2)在windows上安装git,可参考 Git安装----Windows10系统

二、Fork源码

(1)打开CPython的官方github地址,然后点击【fork】按钮

(2)此时即将源码fork到自己的github代码仓下了

三、下载到本地及git配置

(1)首先确保已经在github配置公钥,如未配置,请参考 github基础----配置公钥
(2)本地放代码的文件夹中右键-【git bash here】,打开git bash窗口

(3)在自己的代码仓中拷贝ssh类型的下载链接

(4)在(2)中打开的窗口中执行 git clone 操作,如:

Administrator@redrose2100-NJ MINGW64 /g/src $ git clone git@github.com:redrose2100/cpython.git Cloning into 'cpython'... remote: Enumerating objects: 866263, done. remote: Total 866263 (delta 0), reused 0 (delta 0), pack-reused 866263 Receiving objects: 100% (866263/866263), 419.90 MiB | 2.78 MiB/s, done. Resolving deltas: 100% (687315/687315), done. Updating files: 100% (4556/4556), done.Administrator@redrose2100-NJ MINGW64 /g/src

(5)查看当前本地仓库与远端仓库的关联关系

Administrator@redrose2100-NJ MINGW64 /g/src $ cd cpython/Administrator@redrose2100-NJ MINGW64 /g/src/cpython (main) $ git remote -v origin git@github.com:redrose2100/cpython.git (fetch) origin git@github.com:redrose2100/cpython.git (push)Administrator@redrose2100-NJ MINGW64 /g/src/cpython (main)

(6)设置upstream关联关系,如下:

Administrator@redrose2100-NJ MINGW64 /g/src/cpython (main) $ git remote add upstream git@github.com:python/cpython.gitAdministrator@redrose2100-NJ MINGW64 /g/src/cpython (main) $ git remote -v origin git@github.com:redrose2100/cpython.git (fetch) origin git@github.com:redrose2100/cpython.git (push) upstream git@github.com:python/cpython.git (fetch) upstream git@github.com:python/cpython.git (push)Administrator@redrose2100-NJ MINGW64 /g/src/cpython (main)

CPython入门----Fork源码到自己github并下载配置本地git

CPython入门----下载安装Visual Studio 2017

总结

以上是生活随笔为你收集整理的CPython入门----Fork源码到自己github并下载配置本地git的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。