How do you create local Git repository?

Experience Level: Junior
Tags: GitSource control

Answer

Your local repository can be created in two ways:

Create empty repository

When you start a new project, you usually want to create a new empty repository. This can be done by executing the following command from the command line:

git init

The command above will create the new repository in your current folder. You can also run the following command:

git init <NameOfYourRepository>

The command above will create the new repository in the folder <NameOfYourRepository>. The folder for the new repository will be created in your current folder.

Clone existing repository

When you join an existing project, you usually want to clone already existing repository. This can be done by executing the following command from the command line:

git clone <AddressToYourRepo>

The remote repository will be downloaded to your local computer as a local repository. The remote repository is often called Upstream, the local repository is called Downstream.

Comments

No Comments Yet.
Be the first to tell us what you think.
Git for beginners
Git for beginners

Are you learning Git ? Try our test we designed to help you progress faster.

Test yourself
25 Git questions that will help you to nail your job interview
25 Git questions that will help you to nail your job interview

Are you learning Git ? Try our test we designed to help you progress faster.

Test yourself

Chat

Oh, the operator is not available. Leave us your comments. We will answer all your questions as soon as possible.

Comments

Anonymous
Καλησπέρα.
Anonymous
the infinteis -3/15 so 1triition / infinet
Anonymous
e
Anonymous
<a href="https://inspirum.pl "
Anonymous
[url]https://inspirum.pl[/url]
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e
LaceJaguar65
e