GIT Version Control System

GIT Version Control System

In this article, we'll discuss the git diff command and git tag command. Let’s start!

I will describe this command with an example. Consider I have changed some bugs fixing in the index.html file and changed some color schema in style.css. So I fixed some changes in multiple files. I added in the staging area only the css/style.css file.

Now I need to see what the file is changing and how it is changing between the Working directory and the git repository.

git diff

 

 

In the image above you can see the changes in the working directory and not in the git repository.

If you need to know what the file is changing and how it is changing between the Staging Area and the git repository.

git diff –cached

 

In the image above you can see the changes in the staging area and not in the git repository.

 

Note: In Git, a head is a ref that points to the tip (latest commit) of a branch.

 

Now let's see the git tag command.

git tag command, which enables you to label your commits (and other Git objects) by giving them labels that are simple to read and remember while browsing through a Git repository's history. Simply say it is used to tag the commits.

git tag -a v1.0.1 -m 'bug fixing, stable release'
git tag

 

I hope this is useful for beginners to understand what is git diff and git tag in git.  If you want to interested in watching more videos about git. Please watch Appslanka git videos on our youtube channel. https://www.youtube.com/playlist?list=PLZmKantulzuSeqMy-zM56ZC0S7watreeu. Don't forget to subscribe.

0 Comments

Leave a comment

Your email address will not be published. Required fields are marked *