
A patch is a small file which shows what was changed in a repository. It shows the new changes in an existing file, details of the new files in the current directory, file deletion details etc. A patch file can be pushed to the git repository so that it is useful in the future for updating the changes in the corresponding file.
For creating a patch file in your current git repository, make changes in your files. Now open the terminal.
For unstaged changes, type the following command,