Git Bare Repository

Assume programmer A already have a Working Directory at //serverA/share/proj, and programmer B want to help. A bare reposittory shold be created at //serverB/share by:

git clone --bare //serverA/share/proj

there will be just a folder – proj.git. Now programmer B can get a fresh copy of his own by:

git clone //serverB/share/proj.git

When he finished a few commits, try:

git push //serverB/share/proj.git master

Then programmer A can have the changes by:

git pull //serverB/share/proj.git

The need for a bare repository is due to git rejects any pushing to a non-bare work tree by default. That rule can be overrided by changing config of receive.denyCurrentBranch, but pushing directly to a checked out work tree still feel like tricky.



Leave a comment

Filed under Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s