Re: pushing changes to a remote branch
- From
- Jan Hudec <bulb@ucw.cz>
- Date
- Jul 11, 2007, 19:29 UTC
- Message-ID
- <20070711192959.GB3069@efreet.light.src>
- In-Reply-To
- <20070710143614.GA29681@piper.oerlikon.madduck.net>
On Tue, Jul 10, 2007 at 16:36:14 +0200, martin f krafft wrote:
> git checkout origin/vim > Note: moving to "origin/vim" which isn't a local branch
There is more to that message, no? However, it only says "Head is now at <commit-id>", which does not really indicate, that the HEAD has been "detached". This means that it now contains a commit-id rather than name of some branch.
Git detaches head whenever you check out, without -b option, anything other than branch (without it's refs/heads prefix). If you than check out a branch, you can't see the commit on any branch anymore. However, you can still access it in reflog, ie. via expressions like HEAD@{1} or HEAD@{1 hour ago}.
You should also be able to:
git push origin HEAD:vim
after the commit, and even (I didn't try it, but documentation seems to claim it should work):
git push origin HEAD@{1}:vimif you already changed HEAD more.
You can see this "metahistory" of HEAD via:
git reflog
which is shorthand for git reflog show HEAD
-- Jan 'Bulb' Hudec <bulb@ucw.cz>