We have branch structure - master - develop - feature. We created feature from develop and made few changes in the branch. We don't want to merge all changes from branch . Therefore , trying to create the patch.
When i run git format-patch feature/branch-name , it returns empty response. But, when i run git format-patch origin , it returns the list of files missing between develop and master.
I am not sure why git format-patch will return empty response for branch?
That should be:
A simple
git format-patch develop
would create separate patch files for each commit.But in that latter case, you might want to use the new
--omit-empty
option.With Git 2.41 (Q2 2023), "
git branch --format=...
"(man) andgit format-patch --format=...
(man) learns--omit-empty
to hide refs that whose formatting result becomes an empty string from the output.See commit aabfdc9 (07 Apr 2023) by Øystein Walle (
Osse
).(Merged by Junio C Hamano --
gitster
-- in commit b64894c, 21 Apr 2023)git branch
now includes in its man page:git for-each-ref
now includes in its man page:git tag
now includes in its man page: