**π 1. git init
**Initializes a new Git repository in your project folder.
bash
Copy
Edit
git init
β
Use when starting a new project that you want to track with Git.
**π₯ 2. git clone
**Clones an existing repository from GitHub or any remote source.
bash
Copy
Edit
git clone
β
Use to copy code from a remote repo to your local machine.
**π 3. git status
**Shows the current status of your working directory.
bash
Copy
Edit
git status
β
See which files have been modified, added, or deleted before committing.
**β 4. git add
**Adds files to the staging area (preparing them to be committed).
bash
Copy
Edit
git add filename
or add everything
git add .
β
Use after editing/creating files to stage them.
**πΎ 5. git commit
**Commits your changes with a message.
bash
Copy
Edit
git commit -m "your message here"
β
Records the snapshot of your changes.
**π 6. git pull
**Fetches and merges changes from a remote repository.
bash
Copy
Edit
git pull origin main
β
Use before you start working to make sure you're updated.
**π€ 7. git push
**Pushes your local commits to the remote repository.
bash
Copy
Edit
git push origin main
β
Uploads your code to GitHub or other remote.
**π 8. git log
**Shows a history of commits.
bash
Copy
Edit
git log
β
Useful to review what changes have been made and by whom.
ποΈ 9. git rm
Removes a file from your repo and stage the deletion.
bash
Copy
Edit
git rm filename
π€ Final Thoughts
Learning Git is a journeyβbut it starts with just a few commands. Once you're comfortable with these basics, you'll be able to collaborate, track changes, and contribute to projects with ease.
π Was this helpful? Follow me for more beginner-friendly technical guides!
Top comments (0)