git a command code example

Example 1: git commands

If you want to upload your code first check status

//to check how many files contains changes
1. git status

//to add file to the repository
2. git add youFilePath

//if you want to add all file then
3. git add .

//now commit the code
4. git commit -m "anyMessageYouWantToWrite"

//push the code
5. git push

//if you want code from git then
6. git pull

Example 2: git commands

// displays the staging area
git status

// create a new repository 
git init

// add stages
git add --a or
git add .

// commit
git commit -m "your message"

// know your commit 
git log

// skipping staging area Note: Untrack file will not skip
git command -a -m "your message"



// Config user name and email
git config --global user.name "UserName"
git config --global user.email "emailId"

// check user name and email
git config user.name
git config user.email