Find your content:

Search form

You are here

Learn Git - Configuring Git

 
Share

Now, that we have installed git on our computer, We need to add some quick configurations, there are a lot of options that can be fiddled with, but we are going to set up the most important ones.

Open a terminal and run these commands

git config --global user.name "User name"
git config --global user.email email@email.com

Why we need this? - Every action will have audit entry who made the change.

How to create a new repository?
Git stores its files and history direcly as a folder in your project. To setup a new repository use the below command

git init

The command should respond with something

Initialized empty Git repository...

This means that our repo has been successfully created but it is empty. Now create a simple file called test.txt and save it.

How to check my repo status?
git status

It says which branch you are in and what is the status of added/modified files

How to add files to Git?
Git has the concept of staging area. You could think of this like a blank holder and you can put the files which need to commit.

It starts out empty but you could add the files using below command

git add test.txt

If you want to add everything in the diretory, we can use
git add -A

Now files are ready to commit.

 

 

My Block Status

My Block Content