How to create local git repositories

  1. Create the repo directory (the ‘.’ prefix is to make it hidden)

    mkdir .myrepo.git
    
  2. Go inside the directory

    cd .myrepo.git
    
  3. Initialize the git repo

    git init --bare
    

Our repo is now ready

to clone:

git clone /path/to/.myrepo.git where_to_clone

NOTE: the first push must be

git push origin master

And now you can work from that directory as usual ;)