Last active
November 4, 2025 07:16
-
Star
(191)
You must be signed in to star a gist -
Fork
(28)
You must be signed in to fork a gist
-
-
Save nepsilon/22bc62a23f785716705c to your computer and use it in GitHub Desktop.
Revisions
-
nepsilon revised this gist
Jul 8, 2016 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,8 @@ You think there must be a better way to proceed and you’re right. It’s a sim git diff > some-changes.patch ``` **2\. Apply the diff:** Then copy this patch to your local machine, and apply it to your local working copy with: ```bash git apply /path/to/some-changes.patch -
nepsilon revised this gist
Jul 8, 2016 . 2 changed files with 19 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ # How to generate and apply patches with git? It sometimes happen you need change code on a machine from which you cannot push to the repo. You’re ready to copy/paste what `diff` outputs to your local working copy. You think there must be a better way to proceed and you’re right. It’s a simple 2 steps process: **1\. Generate the patch:** ```bash git diff > some-changes.patch ``` **2\. Apply the dirr:** Then copy this patch to your local machine, and apply it to your local working copy with: ```bash git apply /path/to/some-changes.patch ``` And that’s it! The changes are now in your working copy and ready to be staged/commit/pushed :) -
nepsilon revised this gist
Feb 1, 2016 . No changes.There are no files selected for viewing
-
nepsilon created this gist
Feb 1, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ # Generate the patch: git diff > some-changes.patch # Copy this patch to your local machine # Apply the patch to your local working copy: git apply /path/to/some-changes.patch # And that’s it! The changes are now in your # working copy and ready to be staged/commit/pushed :)