git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Holger Hellmuth <hellmuth@ira.uka.de>
To: "J. Bakshi" <joydeep.bakshi@infoservices.in>
Cc: git@vger.kernel.org
Subject: Re: How to create empty CENTRAL  git with master / development branch ?
Date: Wed, 04 Apr 2012 20:00:17 +0200	[thread overview]
Message-ID: <4F7C8C31.7050206@ira.uka.de> (raw)
In-Reply-To: <201204040711.q347BTXg025316@VM-MailSafe-02.soltecsis.com>

On 04.04.2012 09:11, J. Bakshi wrote:
> well.... I like to create the master just after creating the bare repo.
> So that the users can just start working on it without "git push origin master"

But what do you mean by working on it? The users don't work on the 
central repository, everyone has his own repository. And when this user 
wants to put something into the central repository he needs to push

> As I can already ssh into the central git server, I don't need any further
> ssh://big.brother.edu/repo.git
>
> So what should I do after creating a bare empty repo to generate the master
> there ?

I can give you two answers to that, both somewhat true:

1) The master branch already exists, HEAD already points to it (look 
into the file HEAD).

2) Without a commit that master can point to a master branch can't 
exist. You first have to have a commit that you put into this 
repository. Since it is bare you can't use "git add"+"git commit" you 
have to push it from some other repository

A branch is like a pointer in a programming language, it points to a 
commit. If you don't have any commits, the pointer is NIL. I don't know 
if git has any use for NIL pointers (i.e. an empty /refs/heads/master 
file), but no file refs/heads/master or an empty file refs/heads/master 
means practically the same as having the NIL value (as far as I know)


Instead of "git push -u" you could also clone the bare repository from 
somewhere (it will give a warning), add a file (for example ".gitignore" 
if you want to keep the repository practically empty), commit, and push. 
You can do this locally on the server if you want to.

  parent reply	other threads:[~2012-04-04 17:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-03 10:53 How to create empty CENTRAL git with master / development branch ? J. Bakshi
2012-04-03 14:54 ` Holger Hellmuth
2012-04-03 15:22   ` Tomas Carnecky
2012-04-04  7:11   ` J. Bakshi
2012-04-04 17:16     ` Junio C Hamano
2012-04-04 18:00     ` Holger Hellmuth [this message]
2012-04-04 18:07     ` Holger Hellmuth

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=4F7C8C31.7050206@ira.uka.de \
    --to=hellmuth@ira.uka.de \
    --cc=git@vger.kernel.org \
    --cc=joydeep.bakshi@infoservices.in \
    /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).