How To: Start a (local) repository
related commands:
clone init
Your Git is well configured, it’s time to work! There is two big ways to start a repository:
- It’s a new project or an untracked project
Go to your project directory and just run:
$ git init
That’s it! A new repository has been created. If your project already have sources, you will have to add them.
- The project already has a remote repository
Go to your project directory and run:
$ git clone <path/to/remote.git> .
Logically, <path/to/remote.git>
is given to you by the project maintainer.
With clone
, you will download all current sources, so you can start ot work!
Reminder
clone
Clones remote repository locally
$ git clone <path/to/remote.git>
init
Creates a new local repository
$ git init
Creates a new local repository in the specified directory
$ git init <directory>