Introduction to Git
What is Git?
- version control system
- manage and track changes
- store and retrieve
How does Git work?
- Commits
- Branches
- Revision
Why use Git?
- Track Changes
- Experiments
- Collaboration
Basic Git Commands
git init
Example: git init
git add
Example: git add myfile.txt
git commit
Example: git commit -m "Added new feature"
git status
Example: git status
git push
Example: git push origin main
git pull
Example: git pull origin main
git clone
Example: git clone https://github.com/user/repo
Intermediate Git Commands
git branch
Example: git branch new_branch
git checkout
Example: git checkout branch_name
git merge
Example: git merge branch_name
Advanced Git Commands
git rebase
Example: git rebase main
git stash
Example: git stash save "message"
git reflog
Example: git reflog
git cherrypick
Example: git cherrypick commit_id
git revert
Example: git revert HEAD~2
Thank you for watching