When you want to contribute to an open source repository, you usually fork a repository so you can do your changes and later submit them via a pull re

Sync fork with the original repository using git

submited by
Style Pass
2021-09-04 16:30:09

When you want to contribute to an open source repository, you usually fork a repository so you can do your changes and later submit them via a pull request. After forking the repository on GitHub, and cloning it into your local environment — git clone <forked repository url> — the repository will have a remote URL setup, usually named origin.

You can also do this using GitHub web user interface. Check out the docs! I already mostly use this option, but it’s always useful to know the basics of doing this with git.

To use a s an example, I forked anitab-org/documentation repository into my GitHub account isabelcosta/documentation. When cloning the repository I used the SSH URL of my forked repository. The commands I’ll mention will be running against the repository’s default master branch.

Here the origin configuration will have the URL where your forked project is on GitHub (notice that my isabelcosta account username is there). I am also inside the root directory of the local clone of my forked repository.

Leave a Comment