git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Tue, 7 Dec 2010 03:21:04 +0300	[thread overview]
Message-ID: <20101207002104.GG3264@localhost.localdomain> (raw)
In-Reply-To: <99351291667275@web152.yandex.ru>

On Mon, Dec 06, 2010 at 11:27:55PM +0300, Konstantin Kivi wrote:

[...]
> 1) Is it possible to achieve the same result with git fetch, as I have
> with git push. I have cloned a bare repository (2) from my repository
> (1) and I want fetch made in (2) get all info contained in (1) . I
> talk only about 'master' here. git push from (1) to (2) does the job,
> but git fetch in (1) updates only origin/master, and not master.
`git pull` does exactly that: fetch + merge (which should result in
fast-forward in your case).

> I also found that there is a notions of current branch in bare
> repository (master in my case), that stops my experiments of deleting
> master and making new master out of origin/master.  How can I change
> current branch in bare repositry?
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).
You can use the `git symbolic-ref` to update the HEAD ref.

[...]

P.S.
It's a bit strange you're playing with a bare repository in this way.
Usually a bare repository is supposed to be pushed to and pulled from,
not the other way round. Not that it's bad, but it may turn out you're
inventing a convoluted workflow when there may be a simpler solution.

  reply	other threads:[~2010-12-07  0:21 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 [this message]
2010-12-07 12:31   ` Konstantin Kivi
2010-12-09 13:57     ` Konstantin Khomoutov
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=20101207002104.GG3264@localhost.localdomain \
    --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).