README: Include Procedure for Pulling abi Origin Repo on Fork
FlorentLvr opened this issue · comments
Issue
The README file currently lacks instructions on how to pull updates from the abi origin repository into a forked repository.
Solution
The proposed solution is to add a detailed procedure in the README, outlining the steps to pull updates from the abi origin repository and merge them into a forked repository. This enhancement will provide clear guidance for contributors and ensure that forked repositories stay up-to-date with the latest changes from the abi origin repository.
Pull / push from main abi repository
;TL/DR
# Add remote
git remote add abi https://github.com/jupyter-naas/abi.git
# Push to main branch
git push abi main
# Pull from main branch
git pull abi main
Once you have your fork and own version of the ABI repository, you might want to be able to push/pull to/from the original abi repository to contribute back to the Open Source project.
To do that you need to add a new git remote. A git remote is just a reference to a "remote" location where the project is being hosted/stored.
For example you could have a local git repository, which is hosted on multiple platforms at the same time, so on Github, Gitlab and Bitbucket for example. But on your computer you only want to have a single directory with the project, from which you want to be able to push on a single or all platforms.
Create git remote
To create the git remote you just need to execute the following command, from the repository directory (you need to be in your flavoured ABI folder):
git remote add abi https://github.com/jupyter-naas/abi.git
This will create a new git remote named abi
to which you are now able to push/pull.
Pull from abi remote
Now let's say on local you are on the main
branch, and you want to pull the latest changes from the main branch of the original abi repository (so the abi
git remote). You need to run:
git pull abi main
This is telling git to pull the main
branch from the repository hosted at https://git-scm.com/docs/git-remote
.
Push to abi remote
If you want to push to the original ABI project (you might not have the permissions to push to the main branch), but we will imagine that you have, then you just have to run:
git pull abi main
This is telling git to push to the main
branch of the repository hosted at https://git-scm.com/docs/git-remote
.
Git default remote
When you clone a git repository from Github or any other provider, it will always create a default remote for you, named, origin
. You might already have asked yourself what this origin
was. It's your default git remote.
This means that, assuming you are on the main
branch, executing git push
is the same as git push origin main
.
So by default will just use:
- The branch you are actually on
- The
origin
remote. Even if other exists, it will always useorigin
by default.