You write a code yesterday that works properly and today you change the code and it doesn't work and you don't remember what code you wrote yesterday.
So to deal with this problem, many developers and programmers use Git version control.
Git is a software for tracking changes in any set of files, usually used for coordinating work among programmers, collaboratively developing source code doing software development.
To get started with Git, you need to download it to your machine. Head over to https://git-scm.com/ and download the version most compatible with your system.
In Command Line, Write
For Saving Username
git config --global user.name "User Name"
For Saving Email id
git config --global user.email "email"
Now it is time to learn how we can remote control our project using git.
In Command Line, Navigate to the Project Directory you want to control for that use standard cd command.
cd directory name
Now the time has come to initialize git in our working directory.
for initialize git, use command
Now You Can Check Your Project Status.
Here you are seeing that after entering
the message shows that all the files in the directory are untracked.
In my case, there is an index.js file in my directory.
For Start Tracking the file use
git add "file name"
After Adding the file in Track You can check the status using
Here, You can see that the current status message is different from the previous status message and the color of file name is changed from red to green. This means that your file has been added for tracking.
Imagine that you work in a team where 3 or 4 people are working together in the same project. Now you add some functions to your project and forget to inform your teammates about your changes, Or you also forget which function you added last time. So you can use command for committing the changes.
git commit -m "Message"
Using this command You can see the difference
We can check all commit history using
Here, We can see all commit history with date and time.
Thank You for reading this blog 😀
I hope all of you have benefited after reading this blog 🎉
Here You Connect with me https://connect.rishavraj.codes/