git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: Advice on strategy for "temporary" commits
Date: Fri, 09 Mar 2007 11:15:01 +0100	[thread overview]
Message-ID: <esrbub$bg$1@sea.gmane.org> (raw)
In-Reply-To: e1dab3980703080907v58739287p18bc2797db7d209e@mail.gmail.com

[Cc: git@vger.kernel.org]

David Tweed wrote:

> 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?
[...]]
> 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

  parent reply	other threads:[~2007-03-09 10:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-08 14:39 Advice on strategy for "temporary" commits David Tweed
2007-03-08 16:11 ` Alex Riesen
2007-03-08 16:32 ` J. Bruce Fields
2007-03-08 17:07   ` David Tweed
2007-03-08 18:02     ` Mark Wooding
2007-03-09 10:15     ` Jakub Narebski [this message]
     [not found]       ` <e1dab3980703102101s21401403ja28c6273ecaa7b83@mail.gmail.com>
2007-03-11  5:22         ` David Tweed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='esrbub$bg$1@sea.gmane.org' \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).