On 2/22/12 12:29 PM, James Peach wrote:
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

I do the same, except after the rebase, I've been just doing "git push". Am I risking pushing something I shouldn't ?



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).

To add to that, I'd recommend making every commit message for bug include the TS-xyz. It really helps, and hopefully, at some point we can get git to post those on the Jira tickets too.


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

+1 on "git rebase -i", it's really nice if you want to modify the commit list, and merge changes, modify messages etc.

-- leif

Reply via email to