Objective

Set up a Python project with proper Git workflow and .gitignore.

Tools & Technologies

  • git
  • GitHub
  • gitignore

Key Commands

git init
git add .
git commit -m 'init'
echo '__pycache__/\n*.pyc\nvenv/' > .gitignore

Lab Steps

01
Init Repo

Initialize a git repository for a Python project.

02
.gitignore

Create a proper .gitignore for Python: venv, __pycache__, .pyc, .env.

03
Commit Workflow

Stage, commit, and push changes with descriptive messages.

04
Branching

Create feature branches and merge with pull requests.

Challenges Encountered

  • Accidentally committing venv or .pyc files
  • Merge conflicts in requirements.txt

Key Takeaways

  • Never commit secrets — use environment variables or .env files
  • Commit often with small, focused changes