A Complete Guide For Updating Your Forked Repository
Steps for performing changes to your forked repository, using Fork-and-Branch Git Workflow
Forking the Repository
Log into GitHub: Log in to your GitHub account and navigate the repository that you want to fork.
Fork: Click on the “Fork” button to create your own copy of the repository
Cloning Your Fork
Note: Use the command below to clone your forked repository into the local machine
In your bash git clone https://github.com/YOUR-USERNAME/YOUR-FORK.Git Workflow (ad)git
Cd: Change directory to your cloned folder:
bashcd YOUR-FORK
Fork the original repository
Set Upstream Remote (optional, if original repo would be updated in upstream):
bashgit remote add upstream https://github.com/ORIGINAL-OWNER/OTHERPeoject.git
Creating a Feature Branch
Create a new branch for what you’re about to change:
bashgit checkout -b feature-branch-name
Making Changes
Modify Files: Update your project files with the changes required.
Committing Changes
Staging Changes: Add Files In Staged File Path to the Index
bashgit add.
I’ve finally made changes to the master node, so add a message stating what has been done by the user: # commit your changes with an informative message where this is my last change in case of new committed nodesIDES all running behind internet linesEXIT.
bashgit commit -m “Good message about the changes”
Pushing Changes to GitHub
Push Branch: Push the changes that you made on your fork of GitHub back to it:
Then add a human-friendly alias that maps to the bash command git push origin feature-branch-name
Creating a Pull Request
Create a pull request: Visit your GitHub repository and click on “New Pull Request” to suggest merging the changes you made in this branch with the original repo.
Conclusion
In just 4 Millenial-Proof steps you can be well on your way to project mastery (for projects using the Fork-and-BRanch workflow of course)ifestyles. It is also not a way to make individual modifications and then sync them back with the original project.