So, you have decided to learn about Git? Have a bootcamp or a job that requires it or just trying to be cool?
You came to the right place! Git is at the end not that tough, really, at least the beginning part.
Here I'll explain to you a bit about what I know about Git 🔥
Git is a version control system, its a program that allows you to make changes to your project over time or allow you to go back to the original version.
Git also tracks the changes done over time, making it easy to see what changes have been made.
Before you start:
- Make sure you have created a directory that you want git to follow
- You can also create the files inside the directory, but if you fancy adding them in once you started git it is no biggie
Git won't just follow any old directory without you saying which.
So once you are inside the directory you want git to follow, you simply have to enter on the terminal:
$ git init
Once you see a message that says its initilised, gits got you!
$ git status
This just gives you a picture of where you are in your git journey
$ git add
followed by the file name you have modified adds the file to the staging area.
$ git commit -m
followed by the message in quotation marks takes a snapshot of the work you have done.
- You only need to use 'Initial commit' on the first commit you make
- Afterwards, you can just keep your messages short but clear about what you have done/changed
$ git diff
followed by the file you want to check allows you to see the changes you have done so far
Knowledge is of no value unless you put it into practice.
- You are gonna do great!