Before uploading to GitHub, ensure you have Git installed:
- Visit: https://git-scm.com/download/win
- Download and install Git for Windows
- During installation, keep the default settings
- Restart your terminal/Command Prompt after installation
git --versionSet your Git user information:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"Navigate to the project directory:
cd python-venv-tutorialInitialize Git:
git initStage all files:
git add .Check status:
git statusgit commit -m "Initial commit: Python venv tutorial with examples"- Go to https://github.com/new
- Fill in the repository details:
- Repository name:
python-venv-tutorial - Description: "A comprehensive guide to Python virtual environments with examples"
- Public/Private: Choose Public (to share with others) or Private
- Do NOT initialize README (we already have one)
- Repository name:
- Click "Create repository"
After creating the repository, GitHub will show commands. Run:
git remote add origin https://github.com/YOUR_USERNAME/python-venv-tutorial.git
git branch -M main
git push -u origin mainReplace YOUR_USERNAME with your actual GitHub username.
- Visit:
https://github.com/YOUR_USERNAME/python-venv-tutorial - You should see all your files on GitHub!
If you want to use SSH instead of HTTPS:
- Set up SSH key: https://docs.github.com/en/authentication/connecting-to-github-with-ssh
- Use SSH URL:
git remote add origin git@github.com:YOUR_USERNAME/python-venv-tutorial.git
# Make changes to your files, then:
git add .
git commit -m "Describe your changes here"
git push origin mainSolution: Run git init first, then proceed with steps above.
Solution: You're using SSH but don't have it set up. Use HTTPS instead or set up SSH keys.
Solution: Use git pull origin main first, then git push.
- Add a license to your repository
- Set up GitHub Actions for CI/CD
- Create issues for improvements
- Accept contributions from others
Happy coding! 🚀