Staging Area & Commits
Creating a Commit
Working Directory
We shall refer the project folder as Working Directory.
Let’s add two files
Git’s View of Repository
Inspecting a Repository
Git tracks the changes in the working directory.
- git statusshows the changes in the working directory
Making Changes
Added some content to
alice.txt:
bob.txt:
Steps in Creating a Commit
Add changes to the staging area.
Creating a commit with changes in staging area.
Step 1: Adding Changes To Staging Area
Syntax :
Example :
Step 2: Committing Changes
Syntax :
Here
Example :
Listing all commits
Sample output :
Here HEAD refers to the current commit.
Commit Id
Commit IDs are unique strings(hashes) that are created whenever a new commit is recorded.
Unstaged Changes
Sample output :
Uncommitted Changes
Working with Remote Repository
Pushing Commits
Syntax :
From August 12, 2021, Github has disabled authentication of
You can also edit file and commit changes through github Website
Editing File
Click on the file you want to edit.
Click on pencil icon to open editor :
Commit Changes
To commit changes click on Commit changes .
Get Commit Link
To share specific link of a commit, follow below steps:
Click on commits to view all commits.
Click on commit id of commit you want to share.
Copy the url and share.
Pull Commits
From August 12, 2021, Github has disabled authentication of