First you follow the instructions for :ref:`forking`.
git clone https://github.com/your-user-name/matplotlib.git
cd matplotlib
git remote add upstream https://github.com/matplotlib/matplotlib.gitClone your fork to the local computer with
git clone https://github.com/your-user-name/matplotlib.gitInvestigate. Change directory to your new repo:
cd matplotlib. Thengit branch -ato show you all branches. You'll get something like:* main remotes/origin/main
This tells you that you are currently on the
mainbranch, and that you also have aremoteconnection toorigin/main. What remote repository isremote/origin? Trygit remote -vto see the URLs for the remote. They will point to your github fork.Now you want to connect to the upstream `Matplotlib github`_ repository, so you can merge in changes from trunk.
cd matplotlib
git remote add upstream https://github.com/matplotlib/matplotlib.gitupstream here is just the arbitrary name we're using to refer to the
main `Matplotlib`_ repository at `Matplotlib github`_.
Just for your own satisfaction, show yourself that you now have a new
'remote', with git remote -v show, giving you something like:
upstream https://github.com/matplotlib/matplotlib.git (fetch)
upstream https://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)