I was able to successfully push my commits in my repository by my username and password. But I want to push those commits to someone who exactly forked my repository.I tried to follow this tutorial but It is on how to keep your repository sync with upstream repository. Can anyone help me with this?
Asked
Active
Viewed 83 times
0
-
1You can't do this unless you collaborate with the person that forked from your repo, well .. I think – Charfi Omar Sep 06 '18 at 08:57
-
What about if I am a contributor? – Samuel Mideksa Sep 06 '18 at 09:01
2 Answers
1
You need to:
- Check out their repository
- Create a branch
- Replay the changes from your repository onto your branch in their repository
- Push your changes
- Create a pull request so they can merge your changes

CodeCaster
- 147,647
- 23
- 218
- 272
-
Can you give me an example or a link on how to do those steps especially step number 3? – Samuel Mideksa Sep 06 '18 at 10:13
-
https://stackoverflow.com/questions/3816040/git-apply-changes-introduced-by-commit-in-one-repo-to-another-repo – CodeCaster Sep 06 '18 at 10:14
1
You could set his repository as a secondary remote upstream, like so:
git remote add <name> <url>
Give it any name you'd like, and the url of the forked repo (not the original one).
Then you can follow the same steps as the link you posted, replacing upstream with the upstream name you set up above.

Leonardo Camara
- 11
- 1
-
In which step? If on step 4, you can: a. create another branch from the fork's master branch, e.g. `git checkout fork_upstream/master -b fork/master`, or b. reset the upstream from your local master to point to fork_upstream/master instead. If you have checked out master from origin before, it will still be pointing to it. You would need a local branch pointing to the forked master. – Leonardo Camara Sep 06 '18 at 13:03