Git and Github

Create a local repository in Git with step by step commands

Posted On
Posted By admin

In this article, I will be listing down a few basic instructions to create a local repository in git.

Step 1: Open a command prompt/terminal window. Navigate to the directory where you want to create a git repository.

Step 2: Initialize the directory as a local repository using the following command:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
git init
git init
git init

Step 3: Add the files from the current directory to the local repository:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
git add .
git add .
git add .

 

Step 4: Commit files to your local repository:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
git commit -m "Initial commit"
git commit -m "Initial commit"
git commit -m "Initial commit"

That is all!

If you like this post, please do let me know via the comments box below.  You can also connect with me via my Facebook Page or subscribe to my Youtube channel!

Related Post