[SOLVED] Git newbie - Generating a patch against the git repository

A basic flow:

Summary
# git workflow example for PR submission
# Assumes some setup of the git environs on your build machine i.e. name/email for signoff
# Clone your own forked tree on Github
$ git clone https://github.com/MONIKER/source.git
$ cd source/
# Make a feature branch just for the PR you want to make
$ git checkout -b update-thisBit
# Do your changes and commit them
$ nano package/kernel/thisBit/Makefile 
$ git add package/kernel/thisBit/Makefile 
$ git commit -s -m "target: Add blah and more" -m "Holy verbosity Batman"
# Push your feature branch to Github
$ git push origin update-thisBit
# navigate to https://github.com/MONIKER/source and it should offer you a button to create a pull request.

# if someone wants a change from you, go into your local clone and amend your changes.
# Move back into your cloned source
$ cd source/
# Checkout the feature branch
$ git checkout update-thisBit
# Edit your files again, incorporate the wanted changes
$ nano package/kernel/thisBit/Makefile 
# Amend your commit (means merge the latest changes with those already present in the commit)
$ git add package/kernel/thisBit/Makefile 
$ git commit --amend
# Force-push your rewritten history back to Github
$ git push origin update-thisBit --force
# At this point your pull request commits are automatically updated.

1 Like