gitgit-patch

How to create a git patch from the uncommitted changes in the current working directory without creating a commit?


Say I have uncommitted changes in my working directory. How can I make a patch from those without having to create a commit?


Solution

  • git diff for unstaged changes.

    git diff --cached for staged changes.

    git diff HEAD for both staged and unstaged changes.