Thread (10 messages) flat view 10 messages, 6 authors, 2016-06-15

Re: Cloning empty repositories, was Re: What is the idea for bare repositories?

From: Bill Lear <hidden>
Date: 2016-06-15 22:43:51

Possibly related (same subject, not in this thread)

[I sent a few mistakes --- edited below.]
On Wednesday, November 14, 2007 at 14:16:45 (-0600) Bill Lear writes:
...
Well, here's what we'd like:

% mkdir new_repo
% cd new_repo
% git --bare init

[on another machine:]
% git clone git://host/new_repo
% cd new_repo
% git init
[No git init would be needed here, obviously.]
[add content]
% git commit -a -m "Initial stuff"
% git push

So, this is hard work, and other priorities intrude.  Ok.

Instead, we have to 1) figure out how to do this right, because it's
difficult to remember and not intuitive, and 2) once we have "figured
it out", really figure it out, because there are a few gotchas:

% mkdir new_repo
% cd new_repo
% git --bare init

% mkdir new_repo
% cd new_repo
[git init is needed here...]
[add content]
% git commit -a -m "Initial stuff"
% git config remote.origin.url git://host/new_repo
% git push
[ach! fails!  what's up??]
[poke, read, poke some more, try other things..]
[try setting the remote.origin.fetch?  No, that doesn't work]
[try setting branch.master.remote?  Just edit by hand??]
% git push master
[fails again; read some more; think, think, think...]
% git push origin master
[aha! finally it works]
...
Sorry for the sloppiness.


Bill
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help