Whenever I want to create pull requests to a repo that I don't have write access to, I:
- Fork the original repo to my account.
- Clone the original repo to my local machine.
- Add my fork as an additional remote and make it the push default.
- Make changes in a new branch locally.
- Push this branch to my fork.
- Create a pull request from there.
git clone https://github.com/<origin_org>/<repo_name>.git
cd <repo_name>
git remote add fork [email protected]:<your_name>/<your_repo>.git
git config remote.pushDefault fork
This way, at a later time point I can easily:
- Pull changes from origin into the local master branch.
- Create another contribution branch.
- Push that to my fork.
- Create a new pull request.
cd <repo_name>
git checkout master
git pull
git push # update the fork, which can be relevant for continuous integration checking against the master branch
git checkout -b new-contribution-branch
# make changes and commit
git push
- Setting the push default: https://stackoverflow.com/a/30488025
Thank u for this appreciate your work