* How to create empty CENTRAL git with master / development branch ?
@ 2012-04-03 10:53 J. Bakshi
2012-04-03 14:54 ` Holger Hellmuth
0 siblings, 1 reply; 7+ messages in thread
From: J. Bakshi @ 2012-04-03 10:53 UTC (permalink / raw)
To: git
Dear list,
I need to create git repos on a remote server by the command executed on that server
through ssh as
` ` ` ` `
git --bare init project_name.git
` ` ` ` `
How can I also add the master branch, so that users don't need to
execute [ git push origin master ] ?
Thanks
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to create empty CENTRAL git with master / development branch ?
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
0 siblings, 2 replies; 7+ messages in thread
From: Holger Hellmuth @ 2012-04-03 14:54 UTC (permalink / raw)
To: J. Bakshi; +Cc: git
On 03.04.2012 12:53, J. Bakshi wrote:
> Dear list,
>
> I need to create git repos on a remote server by the command executed on that server
> through ssh as
>
> ` ` ` ` `
> git --bare init project_name.git
you probably meant "git init --bare project_name.git"
> How can I also add the master branch, so that users don't need to
> execute [ git push origin master ] ?
What else do you want them to execute? "git init --bare" creates an
empty repository. Without pushing to it it will always stay empty
Generally: If you want a central repository, the first one to push to it
might do something like this:
git remote add origin ssh://big.brother.edu/repo.git
git push origin master
git config branch.master.remote origin
git config branch.master.merge refs/heads/master
Everyone else could do
git clone ssh://big.brother.edu/repo.git
Now everyone will push to the repository master when they do "git push".
Is that what you wanted to know?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to create empty CENTRAL git with master / development branch ?
2012-04-03 14:54 ` Holger Hellmuth
@ 2012-04-03 15:22 ` Tomas Carnecky
2012-04-04 7:11 ` J. Bakshi
1 sibling, 0 replies; 7+ messages in thread
From: Tomas Carnecky @ 2012-04-03 15:22 UTC (permalink / raw)
To: Holger Hellmuth, J. Bakshi; +Cc: git
On Tue, 03 Apr 2012 16:54:19 +0200, Holger Hellmuth <hellmuth@ira.uka.de> wrote:
> Generally: If you want a central repository, the first one to push to it
> might do something like this:
>
> git remote add origin ssh://big.brother.edu/repo.git
> git push origin master
> git config branch.master.remote origin
> git config branch.master.merge refs/heads/master
or simply: git push -u origin master
tom
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to create empty CENTRAL git with master / development branch ?
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
` (2 more replies)
1 sibling, 3 replies; 7+ messages in thread
From: J. Bakshi @ 2012-04-04 7:11 UTC (permalink / raw)
To: Holger Hellmuth; +Cc: git
On Tue, 03 Apr 2012 16:54:19 +0200
Holger Hellmuth <hellmuth@ira.uka.de> wrote:
> On 03.04.2012 12:53, J. Bakshi wrote:
> > Dear list,
> >
> > I need to create git repos on a remote server by the command executed on that server
> > through ssh as
> >
> > ` ` ` ` `
> > git --bare init project_name.git
>
> you probably meant "git init --bare project_name.git"
Yes right. Sorry for the mistake.
>
> > How can I also add the master branch, so that users don't need to
> > execute [ git push origin master ] ?
>
> What else do you want them to execute? "git init --bare" creates an
> empty repository. Without pushing to it it will always stay empty
>
> Generally: If you want a central repository, the first one to push to it
> might do something like this:
>
> git remote add origin ssh://big.brother.edu/repo.git
> git push origin master
> git config branch.master.remote origin
> git config branch.master.merge refs/heads/master
>
> Everyone else could do
>
> git clone
>
> Now everyone will push to the repository master when they do "git push".
>
> Is that what you wanted to know?
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"
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 ?
# git init --bare project_name.git
# cd project_name.git
.... and can I execute here any command to add master ?
Thanks
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to create empty CENTRAL git with master / development branch ?
2012-04-04 7:11 ` J. Bakshi
@ 2012-04-04 17:16 ` Junio C Hamano
2012-04-04 18:00 ` Holger Hellmuth
2012-04-04 18:07 ` Holger Hellmuth
2 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2012-04-04 17:16 UTC (permalink / raw)
To: J. Bakshi; +Cc: Holger Hellmuth, git
"J. Bakshi" <joydeep.bakshi@infoservices.in> writes:
> On Tue, 03 Apr 2012 16:54:19 +0200
> Holger Hellmuth <hellmuth@ira.uka.de> wrote:
>
>> > git --bare init project_name.git
>>
>> you probably meant "git init --bare project_name.git"
>
> Yes right. Sorry for the mistake.
Just on this part. "git --bare init" is technially more kosher, but it
looks somewhat strange, so "git init" has a special case code to pretend
as if the user said "git --bare init" when "git init --bare" was given.
So both should work fine.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to create empty CENTRAL git with master / development branch ?
2012-04-04 7:11 ` J. Bakshi
2012-04-04 17:16 ` Junio C Hamano
@ 2012-04-04 18:00 ` Holger Hellmuth
2012-04-04 18:07 ` Holger Hellmuth
2 siblings, 0 replies; 7+ messages in thread
From: Holger Hellmuth @ 2012-04-04 18:00 UTC (permalink / raw)
To: J. Bakshi; +Cc: git
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How to create empty CENTRAL git with master / development branch ?
2012-04-04 7:11 ` J. Bakshi
2012-04-04 17:16 ` Junio C Hamano
2012-04-04 18:00 ` Holger Hellmuth
@ 2012-04-04 18:07 ` Holger Hellmuth
2 siblings, 0 replies; 7+ messages in thread
From: Holger Hellmuth @ 2012-04-04 18:07 UTC (permalink / raw)
To: J. Bakshi; +Cc: git
On 04.04.2012 09:11, J. Bakshi wrote:
PS: I always get an error message from your email provider:
-----------------------
joydeep.bakshi@infoservices.in
all relevant MX records point to non-existent hosts or (invalidly)
to IP addresses
-----------------------
I assume you have read my last message on gmane, so I send this to the
kernel mailing list as well.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-04-04 18:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2012-04-04 18:07 ` Holger Hellmuth
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).