Contributing to Github-hosted projects
Some projects provide information about how people should fork and contribute to them. This is my general approach (included here, obviously, for my own edification):
-
Fork a project: Github clickity-click
-
Clone it locally:
git clone git@github.com:username/project.git</pre> -
Add the upstream project:
git remote add upstream git@github.com:upstream/project.git
-
Do not commit to the
masterbranch; it is to be kept up-to-date with upstream master:git pull upstream master -
Create branches that solve one feature or issue each, named whatever:
git branch new-branch-name master -
Create a ‘personal master’ named with your username:
git branch username master -
Do not merge master into feature branches, rather rebase these on top of master:
git rebase new-branch-name -
Merge all personal feature branches into your personal master branch, so you’ve got a branch that represents all your development.
(No doubt I’m missing obvious things, and any git-geek will see instantly the gaps in my knowledge.)
Updates:
To combine the last three commits (and write a new commit message; kudos to Chris Johnsen):
git reset --soft HEAD~3
git commit