๐ฒ Git Basics
Git is a distributed version control system for tracking changes in source code during software development.
Mastering this concept will significantly boost your Python data science skills!
๐ป Code Example:
# โโ Git Complete Workflow Reference โโโโโโโโโโโโโโโโโโโโโโโโโโ # 1. Initial setup (one-time) git config --global user.name "santoshtvk" git config --global user.email "tvk@pynfinity.com" # 2. Initialize & first commit git init pynfinity-project cd pynfinity-project echo "# Pynfinity" > README.md git add README.md git commit -m "chore: initial commit โ scaffold pynfinity project" # 3. Feature branch workflow git checkout -b feature/pebbles-seo # Create & switch git add -A # Stage everything git commit -m "feat: add 27 SEO pebble blog posts" git push origin feature/pebbles-seo # 4. Merging & cleanup git checkout main git merge --no-ff feature/pebbles-seo # Preserve merge commit git branch -d feature/pebbles-seo # Delete local branch # 5. .gitignore essentials cat >> .gitignore << EOF .env __pycache__/ *.pyc .venv/ *.db EOF # 6. Undo & recover git restore --staged app.py # Unstage a file git restore app.py # Discard local changes git revert HEAD # Safe undo (creates new commit) # 7. Stash (save work in progress) git stash push -m "wip: half-done pebble migration" git stash list git stash pop # Restore most recent stash # 8. Log & diff git log --oneline --graph --decorate -10 git diff HEAD~1 HEAD # Changes in last commit
Keep exploring and happy coding! ๐ป