Git | Part-2: Adding, commiting and logging

Mridul RoyMridul Roy
1 min read

TL;DR:

Commands usage for git commit and git log

git add

Add the files to the staging area

Usage

git add <file1>…<filen>: to add the files

git commit

Add the files to the local repository(commiting).

Note: requires commit message

Usage

git commit -m: for adding the commit message inline

git commit -am: for adding the file in staging area and commit message inline at the same time

git log

Shows the commit logs

git log —oneline: showing the short sha for the commits

Usage

git log

0
Subscribe to my newsletter

Read articles from Mridul Roy directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Mridul Roy
Mridul Roy