How to create local git repositories

2012-05-15 · 1 min read
tutorials
  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 ;)

 

Foivos Zakkak
Authors
R&D Software Engineer
Foivos (pronounced [‘fivos]) Zakkak is a Software Engineer in IBM’s (previously Red Hat’s) Java platform team working on Mandrel, GraalVM and Quarkus.