Create a new Git Repository [ 2024 ]
Create a New Git Repository
Repositories are like directories that hold the project files. A Git Repository, also known as a Repo, is a storage space for the project. Git is a distributed version control system that tracks source code changes during software development. It helps multiple developers collaborate on a project by allowing them to work simultaneously, maintain a history of changes, and merge modifications made by different contributors.
Create a New Git Repository
Ensure that Git is installed on your system.  Let’s create a new repository using the git command line.
- Windows Install: Steps to install Git are outlined here.
- Ubuntu Install: Steps to install Git can be found here.
The steps to create a new repository are as follows
- Launch the Git command-line tool.
- Open your terminal or command prompt.
- Create a new project directory.
- Navigate to your project directory using the cd command.
- For example:cd path/to/your/project
- Issue the git init command to initialize the repository.
/> git init
This command creates a new subdirectory named .git that contains all the necessary repository files.
git init
git init command creates a .git folder within the project directory. For example, in the above case:
~\testingdocs\SampleProject\.git
This directory has the information to track the changes to the project. Sample .git folder on Windows machine would like as shown:
Create a Repo on GitHub
Common error
Git Tutorials
Git Tutorials on this website: