Re: git push in a git-init without --bare option?

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

 



On So, 2011-06-26 at 22:21 +0100, Pedro Sa Costa wrote:
> So this means that eveytime that I want a repository to be shared by
> several 
> persons, the repository must always be bare?

Short answer: no.

Long answer: Not necessarily, it depends on your workflow.

You could have a central "official" repository on a server that is
accessible by all members of your team. This is how centralized
version-control systems like Subversion work. You can imitate this with
git, but with git it's just convention, not a technical necessity. This
central repository would then be bare, as nobody will work on it
directly. If connectivity between developers is an issue (e.g. because
of firewalls or NAT), this might be the preferred model in some cases.
You can also use a service like github.com for example.

But you could also use it the distributed way. Then you should
understand and respect the asymmetry between push and pull. Every
developer on a team can have a local (non-bare) repository he works on.
As it is his private repository, all you can say is "hey buddy, I've got
a shiny new feature ready. Pull branch 'foobar' from my private
repository". He can then decide to pull and merge it with his code if he
wishes.

The above doesn't work if you'd allowed everyone to push around stuff to
other developers without their consent. You would lose control over your
own private repository and your working-copy would never be up-to-date
with what is the HEAD of your repo.

Of course, you can have a topology that is far more complex than what I
outlined above, combining bare and non-bare repositories at once and
having multiple repositories per developer, but I hope that the basic
idea became clear.

Regards,
  Chris

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