Re: Commit changes to remote repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx> writes:

> Carlos Martín Nieto <cmn@xxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]