Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git apply patch to the rescue (question) #214

Open
Dagnan opened this issue Aug 28, 2018 · 5 comments
Open

git apply patch to the rescue (question) #214

Dagnan opened this issue Aug 28, 2018 · 5 comments

Comments

@Dagnan
Copy link

Dagnan commented Aug 28, 2018

Hi,
I have a question: I've seen cases where a PR is really bad in terms of merging master multiple times, with commits before, in between etc. The kind of PR you want and should rebase, but it's really hard because of these merges.
In this case you can generate a patch, and then apply it on a new branch, to get the exact copy of your old branch, but less messy.

Is there anything in this guide that talks about a similar method? Or should I add that in a new PR?

@RichardLitt
Copy link
Collaborator

I don't think we have that usecase yet. I would suggest adding it in a PR! This makes sense to me.

@RichardLitt
Copy link
Collaborator

I'd also be curious to see how to make a patch and apply it using Git, without using GitHub's concept of forking and pull requests, which are really opinionated Git maneuvers.

@Dagnan
Copy link
Author

Dagnan commented Jun 20, 2019

I actually had to do that this week. It's pretty basic: on your messed up branch, do git diff master..head > foo.patch, then create a new branch off master and do git apply foo.patch.

I haven't looked at how to create a pull-request for this project though.

@RichardLitt
Copy link
Collaborator

Huh, cool. If you want to add a section on this, I'd love to see it. :)

@ceuk
Copy link
Contributor

ceuk commented Nov 28, 2020

Hey guys, just adding a +1 that I was a bit surprised that the definitive solution to contributing code seems to be "go to Github/another similar site and create a PR".

Obviously, this is by far the most common/modern method, but might be worth having something on git format-patch/am/send-email too? Those are the intended/git native tools to facilitate code sharing after all.

Edit: made a PR instead of just talking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants