On Feb 22, 2012, at 11:18 AM, Alan M. Carroll wrote: > I am still struggling with git. My current issue is how to prepare a > multi-commit branch. For example, I worked on the TS-995 branch locally for a > while, doing multiple commits. I had to merge from master to it a time or > two, to track other changes. The question is, what is the best process for > committing that globally? > > 1) Should I merge to master locally first, then commit master, or commit > directly from the branch?
I get my branch ready and rebase it onto master. Then I do git push origin branch:master > 2) How are commit messages to be done to be useful? Do I have to use the same > commit message every time on the branch, to be sure that it shows up on the > ATS repository? Should I do a rebase and tweak the message there? Use git > commit --amend? I tried "git merge --no-ff ts-995" but that didn't let me set > the commit message. The commit messages from the branch should just show up. If you always rebase your branch and don't merge everything will be what you want (I think). > > I think I'll write a Perl script to do the rebase, which will both squash the > branch commits and make the commit message useful. This should not be necessary. You ought to be able to rebase your branch into the form that you want before pushing it. Have a look at "git rebase -i", it's really handy J