Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

Re: committing to a checked out branch

From: Jay Soffian <hidden>
Date: 2016-06-15 22:46:47

On Tue, May 19, 2009 at 11:09 AM, Jeff Brown [off-list ref] wrote:
When I create a new repo on my server I have been creating an empty
directory, then git init, then git add some file and commit.  I expect
that is the long/wrong way to initialize a repo, especially if I want
it to be bare.  What is the best approach to creating a cloneable bare
repo?
server$ mkdir /path/to/newrepo.git
server$ cd /path/to/newrepo.git && git init --bare
laptop$ git clone ssh://server/path/to/newrepo.git
laptop$ cd newrepo
laptop$ # add; commit; add; commit; ...
laptop$ git push origin master

(This may only work with recent versions of git as I believe earlier
versions used to complain about cloning an empty repository.)

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