git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "Not currently on any branch"
@ 2009-10-02 20:08 Tim
  2009-10-02 20:58 ` Steven Noonan
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tim @ 2009-10-02 20:08 UTC (permalink / raw)
  To: git

I have some code in a git repo that is "Not currently on any branch". Now,
there's the master branch and another branch 'ui-integration' that I'm using in
this project. I don't know how the project got into this headless state, but I
need to be using the 'ui-integration' branch. 

I tried looking around the blogosphere for a solution, and tried what I found
here. But it seems like only my last commit (not the previous 10 I made) shows
up in the master branch (not ui-integration ).  
http://blog.kortina.net/post/71935540/fix-git-not-currently-on-any-branch-problem

What's the most straightforward & cleanest way to merge my changes in the
headless branch to my 'ui-integration' branch? 

Thanks in advance
Tim

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "Not currently on any branch"
  2009-10-02 20:08 "Not currently on any branch" Tim
@ 2009-10-02 20:58 ` Steven Noonan
  2009-10-02 21:46 ` Alex Riesen
  2009-10-04  7:22 ` Clemens Buchacher
  2 siblings, 0 replies; 7+ messages in thread
From: Steven Noonan @ 2009-10-02 20:58 UTC (permalink / raw)
  To: Tim; +Cc: git

On Fri, Oct 2, 2009 at 1:08 PM, Tim <timothyjwashington@yahoo.ca> wrote:
> I have some code in a git repo that is "Not currently on any branch". Now,
> there's the master branch and another branch 'ui-integration' that I'm using in
> this project. I don't know how the project got into this headless state, but I
> need to be using the 'ui-integration' branch.
>
> I tried looking around the blogosphere for a solution, and tried what I found
> here. But it seems like only my last commit (not the previous 10 I made) shows
> up in the master branch (not ui-integration ).
> http://blog.kortina.net/post/71935540/fix-git-not-currently-on-any-branch-problem
>
> What's the most straightforward & cleanest way to merge my changes in the
> headless branch to my 'ui-integration' branch?
>

Try 'git checkout -b temp', which creates a branch called 'temp' with
its HEAD at where you currently are, and then merge your changes to
ui-integration via 'git checkout ui-integration; git merge temp', and
finally drop the junk branch with 'git branch -d temp'

- Steven

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "Not currently on any branch"
  2009-10-02 20:08 "Not currently on any branch" Tim
  2009-10-02 20:58 ` Steven Noonan
@ 2009-10-02 21:46 ` Alex Riesen
  2009-10-02 23:15   ` Sean Estabrooks
  2009-10-04  7:22 ` Clemens Buchacher
  2 siblings, 1 reply; 7+ messages in thread
From: Alex Riesen @ 2009-10-02 21:46 UTC (permalink / raw)
  To: Tim; +Cc: git

On Fri, Oct 2, 2009 at 22:08, Tim <timothyjwashington@yahoo.ca> wrote:
> What's the most straightforward & cleanest way to merge my changes in the
> headless branch to my 'ui-integration' branch?

Assuming you use a Bourne shell:

$ prev=$(git rev-parse HEAD)
$ git checkout ui-integration && git merge $prev

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "Not currently on any branch"
  2009-10-02 21:46 ` Alex Riesen
@ 2009-10-02 23:15   ` Sean Estabrooks
  0 siblings, 0 replies; 7+ messages in thread
From: Sean Estabrooks @ 2009-10-02 23:15 UTC (permalink / raw)
  To: Alex Riesen; +Cc: Tim, git

On Fri, 2 Oct 2009 23:46:53 +0200
Alex Riesen <raa.lkml@gmail.com> wrote:

> On Fri, Oct 2, 2009 at 22:08, Tim <timothyjwashington@yahoo.ca> wrote:
> > What's the most straightforward & cleanest way to merge my changes in the
> > headless branch to my 'ui-integration' branch?
> 
> Assuming you use a Bourne shell:
> 
> $ prev=$(git rev-parse HEAD)
> $ git checkout ui-integration && git merge $prev
> 
> 

You could also rely on the reflog to avoid the need to store off the
previous HEAD value, so just:

$ git checkout ui-integration && git merge HEAD@{1}


Sean

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "Not currently on any branch"
  2009-10-02 20:08 "Not currently on any branch" Tim
  2009-10-02 20:58 ` Steven Noonan
  2009-10-02 21:46 ` Alex Riesen
@ 2009-10-04  7:22 ` Clemens Buchacher
  2 siblings, 0 replies; 7+ messages in thread
From: Clemens Buchacher @ 2009-10-04  7:22 UTC (permalink / raw)
  To: Tim; +Cc: git

On Fri, Oct 02, 2009 at 08:08:52PM +0000, Tim wrote:
> I have some code in a git repo that is "Not currently on any branch". Now,
> there's the master branch and another branch 'ui-integration' that I'm
> using in this project. I don't know how the project got into this headless
> state, but I need to be using the 'ui-integration' branch. 

It can happen either by explicitly detaching HEAD using "git checkout
<commit>", or if you used rebase and it is still in progress.

Clemens

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "Not currently on any branch"
@ 2009-10-05  4:01 Timothy Washington
  2009-10-05  4:19 ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Timothy Washington @ 2009-10-05  4:01 UTC (permalink / raw)
  To: git


Thanks for all the responses so far. But if you take a look at my repo (http://repo.or.cz/w/Bookkeeping.git), at the bottom of the page, there's clearly a 'ui-integration' branch. But if I try to go to my ui-integration branch, I get the message below. So I'm just clueless as to where it went. If use the -b option, then I'll create a new branch. But I don't want that. I want to keep all the data that was in my original 'ui-integration' branch. 

[timothyw] ~/Projects/Bookkeeping.4 $ git checkout ui-integration
error: pathspec 'ui-integration' did not match any file(s) known to git.


These are what's in the files under my .git/ directory. And again, I'm foggy as to where my ui-integration branch went and to how to get it back. 

"HEAD"
cee341c53a249f7d003a12cfeb8cc743275d028f

"ORIG_HEAD"
baca7c9f43e44d67406d3671e0afd84eaea870a3

"config"
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
[remote "origin"]
    url = http://repo.or.cz/r/Bookkeeping.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master

"description"
Unnamed repository; edit this file to name it for gitweb.

fig. 1 


Thanks
Tim 






________________________________
From: Clemens Buchacher <drizzd@aon.at>
To: Tim <timothyjwashington@yahoo.ca>
Cc: git@vger.kernel.org
Sent: Sunday, October 4, 2009 3:22:29 AM
Subject: Re: "Not currently on any branch"

On Fri, Oct 02, 2009 at 08:08:52PM +0000, Tim wrote:
> I have some code in a git repo that is "Not currently on any branch". Now,
> there's the master branch and another branch 'ui-integration' that I'm
> using in this project. I don't know how the project got into this headless
> state, but I need to be using the 'ui-integration' branch. 

It can happen either by explicitly detaching HEAD using "git checkout
<commit>", or if you used rebase and it is still in progress.

Clemens

________________________________
Instant message from any web browser! Try the new Yahoo! Canada Messenger for the Web BETA


      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now
http://ca.toolbar.yahoo.com.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: "Not currently on any branch"
  2009-10-05  4:01 Timothy Washington
@ 2009-10-05  4:19 ` Junio C Hamano
  0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2009-10-05  4:19 UTC (permalink / raw)
  To: Timothy Washington; +Cc: git

Timothy Washington <timothyjwashington@yahoo.ca> writes:

> Thanks for all the responses so far. But if you take a look at my repo
> (http://repo.or.cz/w/Bookkeeping.git), at the bottom of the page,
> there's clearly a 'ui-integration' branch. But if I try to go to my
> ui-integration branch, I get the message below. So I'm just clueless as
> to where it went. If use the -b option, then I'll create a new
> branch. But I don't want that. I want to keep all the data that was in
> my original 'ui-integration' branch.
>
> [timothyw] ~/Projects/Bookkeeping.4 $ git checkout ui-integration
> error: pathspec 'ui-integration' did not match any file(s) known to git.

I do not think it has anything to do with "Not currently on any branch",
but judging from this

> [remote "origin"]
>     url = http://repo.or.cz/r/Bookkeeping.git
>     fetch = +refs/heads/*:refs/remotes/origin/*

one possibility to see the above error message is to do this:

    $ git clone http://repo.or.cz/r/Bookkeeping.git
    $ cd Bookkeeping
    $ git checkout ui-integration
    error: pathspec 'ui-integration' did not match any file(s) known to git.

In a clone, your local branch namespace is not cluttered with all the
different branches your upstream repository has.  To wit:

    $ git branch
    * master
    $ git branch -a
    * master
      remotes/origin/HEAD -> origin/master
      remotes/origin/master
      remotes/origin/ui-integration

If you want to further work on the ui-integration topic, you would do
something like:

    $ git checkout -b ui-integration origin/ui-integration
    Branch ui-integration set up to track remote branch ui-integration from origin.
    Switched to a new branch 'ui-integration'
    $ git branch
      master
    * ui-integration

On the other hand, if you are not interested in working on that topic but
just want to look at it, e.g. merge it to your master:

    $ git branch
    * master
    $ git merge origin/ui-integration

without creating a local ui-integration branch at all (iow, skip that
"checkout -b" step above altogether).

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-10-05  4:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-02 20:08 "Not currently on any branch" Tim
2009-10-02 20:58 ` Steven Noonan
2009-10-02 21:46 ` Alex Riesen
2009-10-02 23:15   ` Sean Estabrooks
2009-10-04  7:22 ` Clemens Buchacher
  -- strict thread matches above, loose matches on Subject: below --
2009-10-05  4:01 Timothy Washington
2009-10-05  4:19 ` Junio C Hamano

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