Git Life Cycle is composed of four stages:

  1. Untracked: This is the initial stage where files are not being tracked by Git.
  2. Staged: In this stage, Git is aware of the files and the changes made to them. However, these changes are not yet committed to the repository.
  3. Committed: This is where the changes made to the files are saved permanently in the Git repository. At this point, the changes are versioned and can be viewed by other users.
  4. Pushed: After committing the changes, they need to be pushed to the remote repository. This stage ensures that changes made to the local repository are reflected in the remote repository as well.

By following this cycle, developers can keep track of the changes made to the codebase and collaborate with others effectively.

Command Git

Configuring username and email address

git config --global user.name "wanda azhar"
git config --global user.email "[email protected]"

Verify that the changes were made correctly:

git config --list

Set default branch to main

git config --global init.default branch main

Get help on a command

git help COMMAND
git COMMAND - h

Initialize a new git repository

git init

Clone a repository

git clone (repo url)

Add a file to the staging area