Housekeeping:
% git checkout master
% git pull upstream master
% git push origin master
Start new topic, edit/add files, commit:
% git checkout -b Random-Topic
% $EDITOR .
% git add .
% git commit -am 'JIRA-NNN: description of what was done'
% ...
% git commit ...
% git checkout master
% git pull upstream master
% git checkout -b JIRA-NNN-Random-Topic
% git squash Random-Topic
% git commit -a
% git hub pull-request
NOTE (1): The final git commit -a
is where you should provide a more detailed commit message; likely the same text that you'd put into the pull request.
NOTE (2): When in vim(1)
, I drop to a shell with <ctrl>+z
; execute git commands, then go back to vim(1)
by typing fg
then <enter>
.
NOTE (3): I use the git-hub extension (shameless plug) to perform the git hub pull-request
command.
This works well about half the time; the other half, the squash will nuke your nice history if you've merged from anywhere else along the way. Most of the time I prefer to rebase -i (with selective squashing) instead of one big squash anyway; better to make the commits into nice logical blocks with.
Also, (2) indicates that you're using vim in a terminal without the benefit of tmux. This is a serious error. :)