I'd like to use git rebase
so as to cleanly merge a feature in the master branch (in less commits or at least at the top of the change log). Note that I'm the only one working on the repository.
After reading http://stackoverflow.com/questions/457927/git-workflow-and-rebase-vs-merge-questions, I found git rebase
would be pretty nice and like Micah I'd like to git push
rebased changes simply because I'm working on them from different places (ex: my notebook, my home, another PC somewhere...)
So here are two solutions (to the bi-directional ugly merge):
- Using
git push -f
to push, and then pulling on other machine, but how to cleanly get the latest version on other machines? - Using merge to merge master changes to the feature branch, git push/pull, and once mature, do a single rebase (in one or more commits cleanly)
(2) would be like below:
git co -b feature-a
... change files
git push origin feature-a
... moving to another PC
git pull origin feature-a
... change files
git merge master
... change files (not the "special rebase")
git rebase master
git co master
git merge feature-a
git branch -d feature-a
git push origin :feature-a
Which solution do you think would work? I haven't tried either of them so far (mostly by fear of making my log more messy).