Git: Generate patch of all commits made on "feature" branch without referring to commit IDs -
we maintain 2 versions of our application in 2 branches: free , master (master being premium version of our application). these branches similar master branch has few application features free version doesn't, need maintain 2 branches ongoing.
regularly need fix bugs or add features free branch, need have applied master branch when they're done. when have such work do, i'll start new branch based on free called, example, newfeature. when i'm done feature, newfeature has x new commits.
before merge newfeature free i'd know command can use generate patch commits contained in newfeature need applied master. currently, i'm doing this:
git format-patch aa99f9..e94904 as far know how do, have specific commit ids of when branched newfeature, , last commit in newfeature, drag. i'm not interesting in commit ids , don't want have type them in.
i want there single command can consistently use in git figure out commits i'm talking about. it's same pattern every time: given branch newfeature, want generate patch of commits common ancestor of newfeature , free latest commit on newfeature.
is there changeset expression out there obviate need manually commit ids?
p.s.: afaik, cannot use git rebase task because merge entire free branch onto master. want merge commits unique newfeature branch onto master.
specifically you're asking is:
git format-patch `git merge-base newfeature free`..newfeature you save time doing this:
git checkout master git cherry-pick `git merge-base newfeature free`..newfeature depending on workflow, might have create patch before merge in feature. i.e.:
git checkout newfeature git rebase free git format-patch free it sound workflow improved basing premium off of free , merging free features premium branch.
Comments
Post a Comment