From: Konstantin Khomoutov <flatworm@users.sourceforge.net>
To: Konstantin Kivi <kkivi@yandex.ru>
Cc: git@vger.kernel.org
Subject: Re: git fetch vs push, git am questions
Date: Thu, 9 Dec 2010 16:57:11 +0300 [thread overview]
Message-ID: <20101209165711.9cca1f28.kostix@domain007.com> (raw)
In-Reply-To: <60371291725083@web106.yandex.ru>
On Tue, 07 Dec 2010 15:31:23 +0300
Konstantin Kivi <kkivi@yandex.ru> wrote:
>> `git pull` does exactly that: fetch + merge (which should result in
>> fast-forward in your case).
> pull does not work on bare repos.
Then the only way to update any branch after fetching I can think of
is using `git update-ref` and the information from FETCH_HEAD.
>>> I also found that there is a notions of current branch in bare
>>> repository
>>> How can I change current branch in bare repositry?
> I think I will understand things better if I get what is 'current
> branch' for bare repository and how to change it
>> By re-writing the HEAD ref (this behaviour is documented in the
>> man page of the `git clone` command, see the "--branch" option for
>> instance).
> The repository already exists, so git-clone will not help
I did not propose to use git-clone, I just stated which section of
which manual page hints at what is considered to be the current branch
in a bare repository when Git clones it.
>> You can use the `git symbolic-ref` to update the HEAD ref.
> Do you mean something like
> git symbolic-ref master origin/master ?
Something like
git symbolic-ref HEAD refs/heads/master
P.S.
I also wonder how did you manage to get origin/master in a bare
repository. When I `git clone --bare` an existing Git repository,
I get one branch named "master" (or whatever branch was current in the
source repository), and in the `git clone` manual page we see:
--bare
Make a bare GIT repository. That is, instead of creating
<directory> and placing the administrative files in <directory>/.git,
make the <directory> itself the $GIT_DIR. This obviously implies the -n
because there is nowhere to check out the working tree. Also the branch
heads at the remote are copied directly to corresponding local branch
heads, without mapping them to refs/remotes/origin/. When this option
is used, neither remote-tracking branches nor the related configuration
variables are created.
Which describes the behaviour I see. So it seems you have somehow
botched setup. Like you took a non-bare repository and just copied its
".git" subdirectory somewhere pretending it's now a bare repo.
next prev parent reply other threads:[~2010-12-09 13:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-06 20:27 git fetch vs push, git am questions Konstantin Kivi
2010-12-07 0:21 ` Konstantin Khomoutov
2010-12-07 12:31 ` Konstantin Kivi
2010-12-09 13:57 ` Konstantin Khomoutov [this message]
2010-12-07 20:14 ` Neal Kreitzinger
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=20101209165711.9cca1f28.kostix@domain007.com \
--to=flatworm@users.sourceforge.net \
--cc=git@vger.kernel.org \
--cc=kkivi@yandex.ru \
/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).