Re: git fetch vs push, git am questions

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

 



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.

--
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]