建立你的复刻

首先,按照说明 制作你自己的Matplotlib拷贝(fork) .

概述

git clone https://github.com/your-user-name/matplotlib.git
cd matplotlib
git remote add upstream git://github.com/matplotlib/matplotlib.git

详细地

克隆你的复刻

  1. 将您的复刻克隆到本地计算机 git clone https://github.com/your-user-name/matplotlib.git

  2. 调查。将目录更改为新回购: cd matplotlib . 然后 git branch -a 向你展示所有的分支。你会得到如下信息:

    * master
    remotes/origin/master
    

    这将告诉您您当前正在 master 你还有一个 remote 连接到 origin/master . 什么是远程存储库 remote/origin ?尝试 git remote -v 查看遥控器的URL。他们会指向你的Github复刻。

    现在你想连接到上游 Matplotlib github 存储库,这样您就可以合并来自主干的更改。

将存储库链接到上游回购

cd matplotlib
git remote add upstream git://github.com/matplotlib/matplotlib.git

upstream 这只是我们用来指主目录的任意名称 Matplotlib 储存库 Matplotlib github .

注意我们用过 git:// 对于URL而不是 https://git@ . 这个 git:// URL为只读。这意味着我们不能意外(或故意)写入上游回购,我们只会使用它来合并到我们自己的代码中。

为了你自己的满意,向你自己展示你现在有了一个新的“遥控器” git remote -v show 给你一些东西,比如:

upstream     git://github.com/matplotlib/matplotlib.git (fetch)
upstream     git://github.com/matplotlib/matplotlib.git (push)
origin       https://github.com/your-user-name/matplotlib.git (fetch)
origin       https://github.com/your-user-name/matplotlib.git (push)