0% found this document useful (0 votes)
76 views4 pages

Git Basic Command

This document outlines basic Git commands for initializing and managing a Git repository locally and connecting it to GitHub. It includes commands for initializing a repository, checking the status, adding and committing files, configuring user information, adding a remote, pulling and pushing changes, cloning a repository, and changing directories.

Uploaded by

shanta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views4 pages

Git Basic Command

This document outlines basic Git commands for initializing and managing a Git repository locally and connecting it to GitHub. It includes commands for initializing a repository, checking the status, adding and committing files, configuring user information, adding a remote, pulling and pushing changes, cloning a repository, and changing directories.

Uploaded by

shanta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Basic Git Command

Md. Nahidur Rahman


Programmer, Nerd Castle
Email: [email protected]
December 10th 2014

Basic Git Command


//To initialize your directory as github repository
git init

//To know the current status of your directory/repository


git status

//To add a single file under tracking


git add filename.extension (example: git add index.html)

//To add all new or modified file under tracking


git add .

//To set username Globally(For All Project)


git config --global user.name "Your_Github_user_name"

//To set Email Globally(For All Project)


git config --global user.email "Your_Github_Email"

================================================
//To set username Locally(For Current Project)

Basic Git Command


git config user.name "Your_Github_user_name"

//To set Email Locally(For Current Project)


git config user.email "Your_Github_Email"

// To add your Remote Repository Location


git remote add origin repository_location

//To Get The Last Updated Version of YOur Project


git pull repository_location

//To Commit a Message What Changed you have done!


git commit -m "Your Message"

//To Upload the Project into your Repository Finally


git push

//To Download a Clone Copy of a Project From GitHub


git clone repository_location

Basic Git Command


//To Create a file into the Current Directory
touch filename.extension (Example: touch index.html )

//To Switch Between Directory


cd folderName

You might also like