1) Download source code from the git repository:
git clone git://address.of.repository/project/ /folder/path/on/my/computer
2) Do some modification on the source code. a new files/folders could be added in the project
3) set your email address and your name for the git commit signature:
git config --global user.name "Your Name"
git config --global user.email [email protected]
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
4) Before commit the changes. we have to add the new files/folders to the local git repository:
under the project folder of the source code
git add <Newfolder>
git add <Newfile>
4) And then commit locally the modification with:
under the project folder of the source code
commit -a
this will open an interactif window
you can check that commit has detected the edited files and the new files under:
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: bin/Makefile.am
# modified: configure.ac
# new file: src/new.c
under the window of commit -a, you have to enter comment for your modifications
and then save your commit with Ctrl + O ( WriteOut) and then Enter and your commit is become saved now
and then quit the commit -a window with Ctrl + X (Exit)
5) now you can generate your patch with:
under the project folder of the source code
git format-patch -1
this will generate a patch file with a name like 0001-...-...-.. .patch
If you want to generate patch with signed-off-by just add -s:
git format-patch -1 -s