GIT is a Version Control System.
It simply means that we can save many versions of a software or code to GIT.
Even more simply we can take this example: suppose you're writing an article in a .txt file and then save it to GIT after committing (1st commit) it. But you forgot to write a quote of a visionary. So you go to that 1st commit in GitHub and then modified & save the article to git (2nd commit). But now you've realized that you don't need the quote anymore and only want the first version of your article without the quote. But in the 2nd commit you've changed the article or file, so now you've to again refer to the 1st commit and get your 1st version of the article.
Now imagine the scenario in a normal editor like Notepad. Here if you save and exit Notepad after writing the article and then again open the file you can't undo the changes by Ctrl + Z. Or you can't get the 1st version of your article after writing and saving multiple times in Notepad.
So in a Notepad also you can go to the 1st version of your article but for that you've to keep Notepad open, because only then you can undo the changes and go back to 1st version. Since people use to save and exit Notepad after writing something hence it cannot work like GIT.
This is how you can use git to get any version of your file if you've committed the changes each time you save it to git or GitHub.
🙏
1 Comments
Nice explanation!!
ReplyDeleteFeel free to write your thoughts in comments!