Code Affairs Web Technologies!

widgets Git Patch Export and Import

For creating a patch from uncommitted changes:

git diff > backup.patch

Create a patch with new untracked files:

git diff --cached > backup.patch

–cached option the diff will compare the staged changes with the local repository.

With binary files (image, video, etc…) for patch:

git diff –cached –binary > backup.patch

Importing Patch

Apply a patch:

git apply backup.patch

bubble_chart Short Description

history_toggle_off Created: March 25, 2019, 9 a.m.

category Related Categories

visibility Total Read: 10