1. git init
Description:
Initializes a new Git repository in your project directory.
Command:
git init
Screenshot:
2. git add
Description:
Stages changes (files or updates) to be committed.
Command:
git add
To stage all files
git add .
Screenshot:
3. git commit
Description:
Records the staged changes to the repository with a message.
Command:
git commit -m "Your commit message"
Screenshot:
4. git status
Description:
Displays the state of the working directory and staging area.
Command:
git status
Screenshot:
5. git log
Description:
Shows the commit history for the current branch.
Command:
git log
Screenshot:
6. git remote add origin
Description:
Adds a remote repository (such as one on GitHub) to your local repository.
Command:
git remote add origin https://github.com/username/repository.git
Screenshot:
7. git branch
Description:
Lists all branches or creates a new branch.
Command:
git branch
Create a new branch
git branch
Screenshot:
8. git branch -M
Description:
Renames the current branch to a new name.
Command:
git branch -M main
Screenshot:
9. git config --global user.name
Description:
Sets your Git username globally on your machine.
Command:
git config --global user.name "Your Name"
Screenshot:
10. git config --global user.email
Description:
Sets your Git email globally on your system.
Command:
git config --global user.email "you@example.com"
Screenshot:
11. git push
Description:
Uploads your committed changes to a remote repository like GitHub.
Command:
git push origin main
Screenshot: