git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: "Carlos Martín Nieto" <cmn@elego.de>,
	ruperty <rupert@moonsit.co.uk>,
	git@vger.kernel.org
Subject: Re: Commit changes to remote repository
Date: Mon, 16 Jan 2012 16:12:30 -0800	[thread overview]
Message-ID: <7vpqejtcep.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <vpqboq6fjfy.fsf@bauges.imag.fr> (Matthieu Moy's message of "Sat, 14 Jan 2012 15:27:29 +0100")

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:

> Carlos Martín Nieto <cmn@elego.de> writes:
>
>> You're trying to push to a non-bare repository and change the
>> currently active branch, which can cause problems, so git isn't
>> letting you. There's an explanation of bare and non-bare at
>> http://bare-vs-nonbare.gitrecipes.de/ but the short and sweet is that
>> you should init the repo you want to use as the central point with
>> --bare and do modifications locally and then push there.
>
> An alternative is to push to a temporary, non-checked-out branch.

Or more generally, treat such a push as if you are pulling in the opposite
direction. So in this example,

> I sometimes do
>
>   laptop$ git push desktop HEAD:incomming
>
> and then
>
>   desktop$ git merge incomming

you pretend as if you are running "git pull" on your desktop in order to
integrate the work done on your laptop. If you did

    desktop$ git pull laptop

you would store where the branches on the laptop are in the remote
tracking branches for "laptop" remote in your desktop's repository.

So a good way to simulate that would be:

    laptop$ git push desktop master:refs/remotes/laptop/master

and then run:

    desktop$ git merge laptop/master

> The push does not disturb the worktree on the desktop, and the merge is
> done manually on the receiving machine.

      reply	other threads:[~2012-01-17  0:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 20:29 Commit changes to remote repository ruperty
2012-01-14 11:31 ` Carlos Martín Nieto
2012-01-14 14:27   ` Matthieu Moy
2012-01-17  0:12     ` Junio C Hamano [this message]

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=7vpqejtcep.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=rupert@moonsit.co.uk \
    /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).