1. git init
Initializes a new Git repo in your current directory.
Explanation: This command turns the current folder into a Git-tracked project.
2. git add
Adds files to staging.
Example: git add .
(adds all files)
Explanation: Staging is like prepping your files before committing.
3. git commit
Saves changes with a message.
Example: git commit -m "Initial commit"
Explanation: It's like hitting "Save" for your project history.
4. git status
Shows the current status of files.
Explanation: Tells you what’s been modified, staged, or untracked.
line.
5. git log
Shows commit history.
Explanation: Your project’s time machine.
6. git branch
Lists all branches.
Explanation: Also used to create branches: git branch feature-xyz
7. git branch -M
Renames your branch.
Example: git branch -M main
Explanation: Use it to switch from master to main (the new standard).
8. git config user.name
Sets your username.
Example: git config --global user.name "YourName"
Explanation: Git will tag commits with this name.
9. git config user.email
Sets your email.
Example: git config --global user.email "you@example.com"
Explanation: GitHub uses this to link commits to your account.
10. git remote add origin
Connects your repo to GitHub.
Example: git remote add origin https://github.com/yourusername/yourrepo.git
Explanation: This sets the destination where you push your code.
11. git push
Sends your commits to GitHub.
Example: git push -u origin main
Explanation: Think of it as uploading your progress online.
AHH! Finally!