This guide will help you set up your development environment and learn the basics of using Cursor IDE with Git and Python.
Before you start, make sure you have the following tools installed:
- Cursor IDE: Download and install from cursor.sh
- Git: For version control
- Python: For development
- GitHub Account: For hosting your code
First, you need to configure Git with your information:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"Python projects often use virtual environments to manage dependencies. We'll use pyproject.toml for modern Python project management. Here's what you need to know:
pyproject.tomlis a configuration file that defines your project's metadata and dependencies- It's the modern standard for Python packaging and project configuration
- It replaces older tools like
setup.pyandrequirements.txt
- Create a GitHub account at github.com
- Set up SSH keys for secure authentication:
ssh-keygen -t ed25519 -C "your.email@example.com" - Add the SSH key to your GitHub account
- Open Cursor
- Create a new directory for your project
- Initialize a Git repository:
git init
- Create a basic Python project structure:
mkdir my_project cd my_project
-
Create a
pyproject.tomlfile:[project] name = "my-project" version = "0.1.0" description = "My first Python project" requires-python = ">=3.9" dependencies = [ "requests>=2.28.0", ]
-
Create a virtual environment:
python -m venv .venv source .venv/bin/activate # On macOS/Linux # or .venv\Scripts\activate # On Windows
# Check status of your files
git status
# Add files to staging
git add .
# Commit changes
git commit -m "Your commit message"
# Push to GitHub
git push origin main- Command Palette: Press
Cmd/Ctrl + Shift + Pto access all commands - Git Integration: Use the Source Control panel (Git icon) to manage your changes
- AI Assistance: Use
Cmd/Ctrl + Kto get AI help with your code - Terminal: Access the integrated terminal with
Cmd/Ctrl + J
- Always commit your changes with meaningful messages
- Keep your virtual environment in
.gitignore - Regularly pull changes from remote repositories
- Use branches for new features or bug fixes
- Cursor Documentation: cursor.sh/docs
- Git Documentation: git-scm.com/doc
- Python Documentation: python.org/doc
- Create your first repository on GitHub
- Clone it to your local machine
- Start coding with Cursor's AI assistance
- Commit and push your changes
Remember: Practice makes perfect! Don't hesitate to experiment with these tools and features.