Re: Advice on strategy for "temporary" commits
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Mar 9, 2007, 10:15 UTC
- Message-ID
- <esrbub$bg$1@sea.gmane.org>
- In-Reply-To
- <e1dab3980703080907v58739287p18bc2797db7d209e@mail.gmail.com>
[Cc: git@vger.kernel.org]
David Tweed wrote:
Show 5 quoted lines
> So, at this point I need to ask an embarassingly basic > question: how do I "change branches" from T (say), in order to commit > to a different branch A, without changing the contents of > the working directory back to match what it was at the > time of the last commit to A?
[...]]
Show 16 quoted lines
> So I'm on the temporary branch and have been doing > temporary commits to it and we hit an hour mark. > Cron wants to commit what's _currently_ in my working > directory as a new head to the "archival branch" A > and then swap back the temporary branch to > commit it on that branch and carry on, ie, make > the diagram look like: > > a-----------a-----------a-----------a > \ $ $ $ > \-t---t---t---t---t---t---t---t---t > > AIUI neither git-branch nor git-checkout provide > a way to do this. (Clearly the git datastructures > can represent this situation, I'm just not sure how > to ask the tools to do it.)
Try if "git checkout -m" does what you wanted. Or simply do a merge of "more often" branch into "less often" branch, perhaps simply not recording it as a merge with "git merge --squash" followed by "git commit".
By the way, you know that you can --amend a commit?
-- Jakub Narebski Warsaw, Poland ShadeHawk on #git