Git fork workflow (Reference)
- Fork the repository, then clone the fork
$ git clone https://github.com/waynee95/<fork>.git- Add original repository as
upstreamto be able to fetch latest updates
$ git remote add upstream https://github.com/<org>/<original-repo>.git- Create and checkout a feature branch
- Make changes to the files
- Commit changes to the branch/fork
$ git checkout -b <new branch>
$ git push origin <new branch>Then create a PR in the original repository.
- After the feature was merged, update the fork
$ git pull upstream master- Delete the feature branch, as not needed anymore
$ git branch -d <branch name>- Update the master branch of the fork
$ git push origin master- And also delete the feature branch in the remote repository
$ git push --delete origin <branch name>- Make sure to always have the most recent version in the fork, since forks do not update automatically!
git pull upstream master
git push origin master