Here are all the commands, starting from creating a new copy of a drupal repository and up to creating the patch to be published in the issue queue, the examples are for drupal core but the same may apply to contrib modules and themes too.
Get the code
git clone --branch 8.x http://git.drupal.org/project/drupal.git
Create a branch
git checkout -b branchnme
git checkout -b 766458-seven-rtl-112