Search code examples
gitarchivestatus

How to archive git status output?


I need to archive some changes which are shown by git status command and keep all the paths, so I can copy it, unarchive and commit on my local machine. I know that git archive command exists but how to use it with git status?


Solution

  • git-archive is meant to archive the whole project, and works only with a commit/tag id. What you want to do is:

    git diff > patchfile
    

    and

    patch -p1 < patchfile
    

    on your local machine.