Now I want to work on something else, but I have changes in my master branch that I don't want to appear in another pull request.
Is there an easy way to tidy this up? If I was to delete the lot and start again that would make things all neat and tidy again but I would rather not change history and I don't know if it would cause problems with the pending pull request...
Any git experts care to comment?
Iain
Feature branches help this situation. If you want to avoid altering history, the simplest thing may be to make a new feature branch from origin/master and work there for awhile. Just don't merge back to master until your pull request has been merged (since anything new on master will get appended to your pull request). Like so:
>
> git checkout origin/master
git checkout upstream/master
> git checkout -b new-feature
>
> Another way that would change history but get you back to a more standard state (where your master matches overtone/master) would be:
>
> git checkout master
> git checkout -b my_feature_branch
> git push -u origin my_feature_branch
> git checkout master
> git reset --hard origin/master
git reset --hard upstream/master
> git push --force origin master
>
I went for the second one, and re-issued the pull request. I now have a nice clean master copy, a branch with my current code in, a branch for my new code, and a small clue how to use git more effectively :-)
Iain