Export Git Stash as patches

Export Git Stash as patches 


git stash show -u -p --binary stash@{0} > your_changes_name.patch

-u  - for untracked files

-p - patch

-binary - for binary files (images)

stash@{0} - for fist stash (most fresh one)

now you can transfer the your_changes_name.patch file to the target machine/repository (e.g., via email, USB drive, or cloud storage). In the target repository:
Verify the patch (optional): git apply --check your_changes_name.patch
  • Apply the patchgit apply your_changes_name.patch. You may use --ignore-whitespace options if conflicts arise due to formatting differences.
  • The changes will appear in your working directory as unstaged modifications

Comments

Popular posts from this blog

Интересное о Формальдегиде

Открываем порт для сервера Minecraft на роутере mikrotik (команда для терминала в WinBox)