Skip to content

Latest commit

 

History

History
149 lines (98 loc) · 2.78 KB

File metadata and controls

149 lines (98 loc) · 2.78 KB

Setup Instructions: Uploading to GitHub

Prerequisites

Before uploading to GitHub, ensure you have Git installed:

Download Git

  1. Visit: https://git-scm.com/download/win
  2. Download and install Git for Windows
  3. During installation, keep the default settings
  4. Restart your terminal/Command Prompt after installation

Verify Installation

git --version

Step 1: Configure Git (First Time Only)

Set your Git user information:

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

Step 2: Initialize Local Repository

Navigate to the project directory:

cd python-venv-tutorial

Initialize Git:

git init

Step 3: Add Files to Git

Stage all files:

git add .

Check status:

git status

Step 4: Create First Commit

git commit -m "Initial commit: Python venv tutorial with examples"

Step 5: Create GitHub Repository

  1. Go to https://github.com/new
  2. 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)
  3. Click "Create repository"

Step 6: Push to GitHub

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 main

Replace YOUR_USERNAME with your actual GitHub username.


Step 7: Verify Upload

  1. Visit: https://github.com/YOUR_USERNAME/python-venv-tutorial
  2. You should see all your files on GitHub!

Alternative: Using SSH (Recommended for Frequent Pushes)

If you want to use SSH instead of HTTPS:

  1. Set up SSH key: https://docs.github.com/en/authentication/connecting-to-github-with-ssh
  2. Use SSH URL:
    git remote add origin git@github.com:YOUR_USERNAME/python-venv-tutorial.git

Common Commands for Future Updates

# Make changes to your files, then:
git add .
git commit -m "Describe your changes here"
git push origin main

Troubleshooting

Issue: "fatal: not a git repository"

Solution: Run git init first, then proceed with steps above.

Issue: "Permission denied (publickey)"

Solution: You're using SSH but don't have it set up. Use HTTPS instead or set up SSH keys.

Issue: "Updates were rejected"

Solution: Use git pull origin main first, then git push.


Next Steps

  • Add a license to your repository
  • Set up GitHub Actions for CI/CD
  • Create issues for improvements
  • Accept contributions from others

Happy coding! 🚀