Two things you’ll do often
- Clone - Download existing projects from GitHub
- Create - Start new projects and upload them
Cloning a repository
Cloning means downloading a project from GitHub to your computer.Example: Clone an AI project
Let’s clone a real project to see how it works:- HTTPS (Recommended)
- SSH
If
code . doesn’t work, you need to enable it first:Mac:- Open VS Code
- Press
Cmd + Shift + P - Type “Shell Command: Install ‘code’ command in PATH”
- Press Enter
- Restart your terminal
- During VS Code installation, check “Add to PATH”
- If you missed it, reinstall VS Code and check that option
- Or manually: Right-click project folder > “Open with Code”
What just happened?
- Git downloaded all files
- Git downloaded all history
- You can now run, modify, and learn from this code
Creating your own repository
Let’s put yourpython-for-ai project on GitHub.
Step 0: Create .gitignore file
Before anything else, create a.gitignore file in your project:
Step 1: Create on GitHub
- Go to github.com
- Click the green “New” button (or + icon > “New repository”)
- Fill in:
- Repository name:
python-for-ai - Description: “Learning Python for AI development”
- Public/Private: Choose Private for now
- Don’t add README, .gitignore, or license
- Repository name:
- Click “Create repository”
Step 2: Connect your local project
GitHub will show you commands. Choose based on your authentication method:- HTTPS (Recommended)
- SSH
When you push, GitHub will ask for your username and the personal access token (not your password!). VS Code will remember it.
The daily workflow
Once your project is on GitHub:Common tasks
Clone with VS Code UI
Clone with VS Code UI
- Press
Ctrl/Cmd + Shift + P - Type “Git: Clone”
- Paste the repository URL
- Choose where to save it
- VS Code opens the project automatically
Private vs Public repos
Private vs Public repos
- Private: Only you can see it (good for learning)
- Public: Anyone can see it (good for portfolio)
- You can change this later in Settings
The .gitignore file
The .gitignore file
.venv/ folder can be several gigabytes!Practice exercise
Try this:- Clone any Python project that interests you
- Create a new repo for one of your practice scripts
- Make a change, commit, and push
What’s next?
VS Code makes Git even easier with visual tools. Let’s explore those.VS Code Git
Use Git without the terminal