wvh
wvh

Reputation: 191

Reformat regular diff patch to git format

Is there an easy way to reformat a regular (unified) diff patch into a git-format patch? What I want to do, is take a regular patch someone sends me and apply it with git, adding author information – as if it were a git-format patch.

I don't really want to start manually rewriting the patch, so I was wondering if there is perhaps a git command I haven't found out about yet that does this.

It seems like a problem others must have had before...

Thanks!

Upvotes: 6

Views: 2542

Answers (1)

Tobu
Tobu

Reputation: 25426

git apply < patch; git commit; git format-patch HEAD^

Upvotes: 3

Related Questions