wiki:HowToSendPatches

Git workflow to send patches

We will describe the git workflow how you can create patches and send it to the mailing list. For more information you should read the book and watch the video tutorials at  http://book.git-scm.com/.

# The first thing you're going to want to do is set up your name and email address
# for git to use to sign your commits.
git config --global user.name "Andreas Schneider"
git config --global user.email "mail@cynapses.org"

# Clone the repository
git clone git://git.libssh.org/projects/libssh/libssh.git
cd libssh

# Set your name and email

# create a new branch based on the master branch
git checkout -b feature1 origin/master

# lets assume we add a new function in libssh/channels.c
work work work

# Add the file to the next commit, ('git add -i libssh/channels.c' if
# you just want to commit hunks)
git add libssh/channels.c

# The first comment line should be a short description max. 60 chars.
# Then an empty line and the full description. Maybe the short comment is enough.
# Remember to commit early and often. Don't submit feature and bugfixes as one patch.
git commit

# Create the patches you've done. You can reorder or merge them with 'git rebase'.
git format-patch -s origin/master

# Now send the patches to the mailing list. You can use 'git send-email' too.

# You can delete the branch if you want.
git checkout master
git branch -D feature1