-
Clone the Repository: First, clone the repository to your local machine using the following command:
git clone https://github.com/aousabdo/phidata.git
-
Add the Original Repository as a Remote: Add the original repository (often referred to as the "upstream" repository) as a remote to your local repository. This allows you to pull updates from the original repository. Use the following commands:
cd phidata git remote add upstream https://github.com/phidata/phidata.git
-
Verify the Remotes: Verify that the new remote has been added correctly by using the following command:
git remote -v
You should see output similar to this:
origin https://github.com/aousabdo/phidata.git (fetch) origin https://github.com/aousabdo/phidata.git (push) upstream https://github.com/phidata/phidata.git (fetch) upstream https://github.com/phidata/phidata.git (push)
-
Fetch Updates from Upstream: Fetch updates from the upstream repository to ensure you have the latest changes. Use the following command:
git fetch upstream
-
Merge Updates into Your Local Branch: Merge the fetched updates into your local branch. Assuming you are working on the
main
branch, use the following commands:git checkout main git merge upstream/main
-
Resolve Conflicts: If there are any merge conflicts, Git will notify you. Resolve the conflicts in your preferred text editor, then add the resolved files and commit the merge:
git add <resolved_file> git commit
-
Push Changes to Your Fork: After merging the updates from the upstream repository, you can push the changes to your forked repository on GitHub:
git push origin main
By following these steps, you can keep your local repository up to date with changes from the original repository while working on your forked version.