Commit changes of file

Author: Al-mamun Sarkar Date: 2020-04-12 14:17:10

Commit changes of file. Before commit you have to add the file to git. The following command shows how to show status adding file and committing changes.

Show the list of files:

git status

 

Show difference of files:

git diff

 

Adding file to staged:

git add [file]

Add all files to files to staged:

git add .

Show difference of staged files:

git diff --staged

 

Unstaged file:

git reset [file]

 

Commit staged files:

git commit -m"commit message"

 

Add and commit:

git commit -am"commit message"