How "git commit" can make your life easy as a programmer?

How "git commit" can make your life easy as a programmer?

Β·

2 min read

So, You are a programmer, right? Yes I mean you write code in different languages or maybe you used to create some apps/websites for mobile or desktop.

But do you even know how Git makes your life easy to manage your project or code?

Let's see the use of "git commit" in the programming world! First, we'll see what is git?

what is Git?

Git is a version control system, It is an Open Source project created by Linus Torvalds in 2005.

Wait... you don't know who is Linus Torvalds? Dude! you really need help! This man has done a lot for people like us (programmers). He is the founder of the Linux operating system kernel [The only tool I need right now]. Click here to learn more about Linux.

Features of Git Version Control.

As this tutorial is meant to be designed for beginners, I am not going too deep into this topic rather I will explain the easy way to use "Git".

  • Git will help you to monitor your project, You can check what changes you have done in your project when & why?

  • Go back to the previous state of your project. Git will save all the files and codes whether it is deleted from your local machine or not. All you have to do is use the commit command to save your state.

Git is :

  • FAST

  • SECURE

  • FLEXIBLE

  • SCALABLE

  • FREE & OPEN-SOURCE

How to use "git commit"?

Create a project in your favourite IDE or Editor, open that folder in terminal and follow the command given below.

# initialize an empty git repository inside your project
git init

# Add your files to the git repository {filename = it is the name your file if onle single file is available in your project}
git add filename
# or use dot (.) if you have multiple files and folder in your project.
git add .

# Now, commit your changes into git repository
#write a commit message (it can be anything of your choice)
git commit -m "This is my first git commit"

You are all set for now! If you want to learn more about Git. Click here to see the official documentation.

I hope this is a bit useful for you. Check my YouTube channel for interesting tech tutorials.

Ankit Ojha YouTube.

Β