Skip to content

Instantly share code, notes, and snippets.

@ethaizone
Created May 17, 2018 08:08
Show Gist options
  • Save ethaizone/3cfaefdaba845c337ffca8443615b337 to your computer and use it in GitHub Desktop.
Save ethaizone/3cfaefdaba845c337ffca8443615b337 to your computer and use it in GitHub Desktop.
Save working space by git stash then make patch file for apply later.
# Credit: https://stackoverflow.com/questions/3973034/export-a-stash-to-another-computer
# First just stash your working space
git stash
# Maybe you need check your stash which file that have right now.
git stash show
git stash show -p
# Create patch file from whole your stash
git stash show -p > your_patch.patch
# Later if you need to apply patch back to working space
git apply your_patch.patch
@ethaizone
Copy link
Author

ethaizone commented Oct 3, 2024

How to share current working space with others as a patch

I created this again to make it easier to read.

For the sender:

  1. Add all files to staging:
    git add .

  2. Create a patch file:
    git stash
    git stash show -p > your_patch.patch

  3. Send the patch file to others.

For the receiver:

  1. Apply the patch in your branch:
    git apply your_patch.patch

Note: You can resolve conflicts if they occur during application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment