title: How to properly initialize a remote git repository
body: <p>I have a local git server running on my NAS and I'm developing on my laptop and workstation, all in my local network. So, if I want to start a project in a new empty repo, I'm following <a href="https://stackoverflow.com/questions/6648995/how-to-create-a-remote-git-repository-from-a-local-one">this answer</a> and </p>
  
  <ol>
  <li>create a bare repo "mynewproject.git" on the NAS <code>cd ${PROJECT}.git; git init --bare</code></li>
  <li>create an empty 'repo' "mynewproject", also on the NAS <code>cd ${PROJECT}; git init</code></li>
  <li>make an initial commit in "newproject" <code>git add . ; git commit -m "initial commit" -a</code></li>
  <li>make the bare repo the remote origin of the current folder <code>git remote add origin ssh://${USER}@${REMOTEIP}${PROJECT}.git</code></li>
  <li>push to master <code>git push origin master</code></li>
  <li>delete the 'project' directory <code>rm -rf $PROJECT</code></li>
  </ol>
  
  <p>And then I can clone the <code>${PROJECT}.git</code> repo from other machines. This whole process seems overly complicated. I mean, I scripted it,</p>
  
  <pre><code>HOSTIP=XXX.XXX.XXX.XXX
  USER=YYYYY
  PROJECT=$1
  
  [[ -z "${PROJECT}" ]] &amp;&amp; exit 1
  
  PROJECTNAME=${PROJECT}
  PROJECT=$(pwd)/${PROJECT}
  
  # create project and .git folders
  mkdir ${PROJECT}
  mkdir ${PROJECT}.git
  
  # initialize folders for git
  cd ${PROJECT}.git
  git init --bare
  cd ${PROJECT}
  git init
  
  # create initial project directory
  echo "#!/bin/bash" &gt; ${PROJECT}/ENV_${PROJECTNAME}.sh
  git add .
  git commit -m "initial commit" -a
  
  # 'link' to 'remote' .git folder 
  git remote add origin ssh://${USER}@${HOSTIP}${PROJECT}.git
  
  # push to master
  git push origin master
  
  # delete 'project' directory
  rm -rf $PROJECT
  
  echo "CREATED PROJECT $PROJECT.git"
  echo "Clone with git clone ssh://${USER}@${HOSTIP}${PROJECT}"
  
  exit 0
  </code></pre>
  
  <p>but still, is this the right way to go about this?</p>