15

Let's say a repo named cool-stuff is on github.
I have a fork of cool-stuff and I have submitted a PR associated with my fork of cool-stuff which is waiting to be merged.

Now, there is another independent fork of cool-stuff,say, even-cooler-stuff which works on new features to introduce to cool-stuff. I would like to contribute to the even-cooler-stuff repo but github won't let me since I already have a fork of cool-stuff.

Is there any way to do what I want like this or should I manually tell the author of even-cooler-stuff the changes I want to do?

you are viewing a single comment's thread
view the rest of the comments
[-] Lodra@programming.dev 9 points 1 year ago

Create a new branch on your fork. You need it to be synced with the other fork so there are a few extra tricky steps. On your new branch, you need to delete the latest commits that aren't merged yet so that it matches the original repo. Then add a remote for the other fork and pull. Now you can build against the other fork and submit a PR to it.

git checkout -b even-cooler-stuff
# Remove the last 8 commits. Change this number as needed. Increasing it "too high" is just fine 
git reset HEAD~8 --hard
git remote add even-cooler-stuff https://github.com/more-of-url/even-cooler-stuff
git pull even-cooler-stuff

You should now have a branch that matches the other fork. Make your changes, commit, and push normally. When you build the PR, you want to merge into the other fork.

Disclaimer: I wrote this on my phone and from memory. There are probably typos and possibly other mistakes. Good luck!

this post was submitted on 05 Aug 2023
15 points (85.7% liked)

Programming

17087 readers
187 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS