DEV Community

Manoj M S
Manoj M S

Posted on

Basic Git Commands

Step By Step Guide to make your first Repository:

Step 1:

Make a Folder:

 \Desktop> mkdir First-repo
 \Desktop> cd First-repo

Step 2:

Initialize The Repository:

 \Desktop\First-repo> git init
  Initialized empty Git repository in 
  C:/Users/LALITHA/Desktop/First-repo/.git/

Step 3:

Create New File index.html inside First-repo folder.

Step 4:

Check Status :

  \Desktop\First-repo> git status
   On branch master

   No commits yet

   Untracked files:
   (use "git add <file>..." to include in what will be 
    committed)
    index.html

   nothing added to commit but untracked files present (use 
   "git add" to track)

Step 5:

Add Your Changes:

  \Desktop\First-repo> git add .

Step 6:

Commit Your Changes:

 \Desktop\First-repo> git commit -m"Message"
 [master (root-commit) 0b98ccc] Message
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 index.html

Step 7:

Push Your Changes:

 \Desktop\gitexample\First-repo> git remote add origin 
  https://github.com/Manoj-M-S/First-repo.git
 \Desktop\gitexample\First-repo> git push -u origin master

Thank you for reading!

Top comments (0)