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

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.)

  • Remove version history of a single file in Git
  • in fugitive.vim show diff between target|merge and common ancestor
  • How to switch android version in local repo?
  • SQLite database pushed to EC2 server having trouble
  • Build Configurations for Git Flow
  • unwind some merges in working copy
  • copy a git repository without revisions (without .git and .gitingore) from a remote server
  • Git: A ton of blank lines showing up in diff when I haven't modified them
  • In Jenkins, what does the “Publish to Subversion repository” in Add post-build action dropdown do?
  • App pushed to heroku still shows standard index page
  • How to copy the last commit from one branch to master branch
  • Install git via homebrew on mac osx 10.10 results in: Error: Permission denied - /usr/local/lib/perl5/site_perl/5.18.2
  • One Solution collect form web for “How can i generate a patch file from all commits in a local branch (GIT)?”

    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

    Git Baby is a git and github fan, let's start git clone.