From: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jakub Narebski <jnareb@gmail.com>,
Matthieu Moy <Matthieu.Moy@imag.fr>,
Salikh Zakirov <salikh@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: [RFC] Introduce .git/BRANCH to point to the current branch
Date: Fri, 7 Dec 2007 00:39:54 +0100 [thread overview]
Message-ID: <200712070039.55249.robin.rosenberg.lists@dewire.com> (raw)
In-Reply-To: <7vir3e428i.fsf@gitster.siamese.dyndns.org>
tisdag 04 december 2007 skrev Junio C Hamano:
> Jakub Narebski <jnareb@gmail.com> writes:
>
> >> Currently, I can do:
> >>
> >> # Oh, what did this look like two commits ago?
> >> $ git checkout HEAD^^
> >> # Ah, OK, let's go back to the tip
> >> $ git checkout branch-name
> >> ^^^^^^^^^^^
> >> But I have to remember and re-type the branch name.
> >
> > No, you don't have. You can use
> > $ git checkout ORIG_HEAD
> > or
> > $ git checkout HEAD@{1}
>
> But the point is he wants to go back to the branch he came from. He
> does not want to detach HEAD at the original commit.
>
> Having said that, I am not sympathetic to "I have to remember".
I abuse git bisect for this temporary switcing. It only gives me a one
level memory, but otoh the git prompt tells me I'm on a discourse.
[me@lathund GIT (rr/abspath|BISECTING)]$ git checkout master
Switched to branch "master"
[me@lathund GIT (master|BISECTING)]$ git checkout HEAD~2
Note: moving to "HEAD~2" which isn't a local branch
If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
git checkout -b <new_branch_name>
HEAD is now at afcc4f7... Merge branch 'js/prune-expire'
[me@lathund GIT (afcc4f7...|BISECTING)]$ git bisect reset
Previous HEAD position was afcc4f7... Merge branch 'js/prune-expire'
Switched to branch "rr/abspath"
[me@lathund GIT (rr/abspath)]$
-- robin
next prev parent reply other threads:[~2007-12-06 23:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-04 20:08 [RFC] Introduce .git/BRANCH to point to the current branch Salikh Zakirov
2007-12-04 20:19 ` Matthieu Moy
2007-12-04 20:42 ` Jakub Narebski
2007-12-04 20:46 ` Junio C Hamano
2007-12-04 21:32 ` Matthieu Moy
2007-12-04 21:48 ` Junio C Hamano
2007-12-04 22:04 ` [PATCH] git-checkout --push/--pop Nanako Shiraishi
2007-12-05 6:59 ` Junio C Hamano
2007-12-05 10:26 ` Matthieu Moy
2007-12-05 17:44 ` David Kågedal
2007-12-06 23:39 ` Robin Rosenberg [this message]
2007-12-04 21:57 ` [RFC] Introduce .git/BRANCH to point to the current branch Salikh Zakirov
2007-12-04 22:06 ` Junio C Hamano
2007-12-04 22:08 ` Jakub Narebski
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=200712070039.55249.robin.rosenberg.lists@dewire.com \
--to=robin.rosenberg.lists@dewire.com \
--cc=Matthieu.Moy@imag.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jnareb@gmail.com \
--cc=salikh@gmail.com \
/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).