inter-git

The Basic Usage of Git

The Basic Usage of Git
So, how do you actually use Git in your day-to-day work as a beginner?

When you start a new project, the first step is to initialize a Git repository for it by running the git init command. This sets up Git in your project folder, and you only need to do this once for each project.
Next, you typically add a file and work on it for a while. Once you reach a milestone, you add the file to the Index by using the git add command and then save your progress with the git commit command. This creates a snapshot of your work at that point in time.
As you continue working, you will keep modifying your files—sometimes adding new content and other times removing parts you no longer need. Each time you reach another milestone, you again add the file to the Index with git add and create a commit with git commit. You repeat this process for all the files you add or modify in your Working Directory, building up a history of commits as you go.
There will also be situations where you remove or rename a file. In such cases, you use the git rm command to delete a file or the git mv command to rename it. After making these changes, you record them permanently by running the git commit command.
This is what your basic usage of Git will look like as a beginner: you edit files, add them to the Index, commit them, and then repeat the process as your project grows.

Lesson Completed!