Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i generate a patch file from all commits in a local branch (GIT)?

Tags:

git

patch

I would like to generate a patch with all commits from a local branch. Without Comparing to the master. (because a part of the commits are already merged with the master.)

like image 780
bitrevolution Avatar asked Jan 01 '26 05:01

bitrevolution


1 Answers

You can use git diff srchash..HEAD > whatever.patch with srchash being the SHA-1 of the base commit. If the branch is not currently checked out, use branchname instead of HEAD

like image 199
ThiefMaster Avatar answered Jan 02 '26 22:01

ThiefMaster