All Guides
GitHub
Beginner

GitHub Basics Guide

Learn how to save, manage, and share your AI-generated code with GitHub

Chapter 1 covers the basics of GitHub, setting up your account, and creating your first repository.

Introduction to Version Control

When you create code with AI tools like v0, you need a way to save your work, track changes, and share it with others. That's where GitHub comes in.

GitHub is like a Google Drive for code, but with powerful features designed specifically for software development. It helps you:

  • Save your code in a secure, cloud-based location
  • Track changes over time so you can go back to previous versions
  • Collaborate with others without overwriting each other's work
  • Deploy your projects to the web directly from your code repository
GitHub workflow diagram showing how code moves from local to remote repository

Getting Started with GitHub

1. Create a GitHub Account

First, you'll need to create a free GitHub account if you don't already have one.

2. GitHub Terminology Simplified

Repository (Repo)

A project folder that contains all your code files and their history.

Commit

A saved snapshot of your code at a specific point in time.

Branch

A separate version of your code, like a parallel timeline.

Clone

Making a copy of a repository on your computer.

Push

Uploading your local changes to GitHub.

Pull

Downloading the latest changes from GitHub to your computer.

Fork

Creating your own copy of someone else's repository on GitHub.

Merge

Combining changes from one branch into another.

GitHub Desktop Setup

While you can use GitHub directly through the command line, GitHub Desktop provides a user-friendly visual interface that's perfect for beginners.

1. Download and Install GitHub Desktop

Download GitHub Desktop

2. Connect to Your GitHub Account

GitHub Desktop login screen
  1. Open GitHub Desktop after installation
  2. Click "Sign in to GitHub.com"
  3. Enter your GitHub username and password
  4. Complete any two-factor authentication if prompted
  5. Configure your name and email for Git commits when asked

Your First Repository

Creating a New Repository

  1. In GitHub Desktop, click on "File" > "New Repository" or use the "Create a New Repository" button

    Creating a new repository in GitHub Desktop
  2. Fill in the repository details:

    • Name: Choose a descriptive name for your project
    • Description: (Optional) Add a short description
    • Local Path: Choose where to save the repository on your computer
    • Initialize with README: Check this box (recommended)
    • Git Ignore: Choose a template based on your project type (e.g., Node)
    • License: Choose an open-source license (MIT is a good default)
  3. Click "Create Repository"
  4. Publish your repository to GitHub by clicking "Publish repository"

    Publishing a repository to GitHub

Basic GitHub Workflow

The GitHub Workflow

GitHub workflow steps diagram

The basic GitHub workflow consists of these steps:

  1. Make changes to your code using your preferred editor
  2. Review changes in GitHub Desktop to see what you've modified
  3. Commit changes with a descriptive message explaining what you did
  4. Push changes to upload your commits to GitHub

Making Your First Commit

  1. Make some changes to your project files using any code editor

  2. Open GitHub Desktop and you'll see the changed files highlighted

    GitHub Desktop showing changes to files with code diff view
  3. Write a summary of your changes in the "Summary" field (e.g., "Update header styling")

    Optionally, add more details in the "Description" field

  4. Click "Commit to main"

  5. Click "Push origin" to upload your changes to GitHub

Working with Branches

What Are Branches?

Branches allow you to work on different versions of your code simultaneously. Think of them as parallel timelines where you can develop features or fix bugs without affecting the main codebase.

GitHub branches diagram showing main branch and feature branches

When to Use Branches

  • Developing new features
  • Fixing bugs
  • Experimenting with code changes
  • Working on multiple features simultaneously

Branch Naming Conventions

  • feature/add-login - For new features
  • bugfix/fix-header - For bug fixes
  • hotfix/critical-error - For urgent fixes
  • release/v1.0 - For release preparation

Creating and Using Branches in GitHub Desktop

Forking Repositories

What is Forking?

Forking creates your own copy of someone else's repository on GitHub. This allows you to freely experiment with changes without affecting the original project.

When to Fork a Repository

  • Contributing to open-source projects
  • Using someone else's project as a starting point
  • Experimenting with changes to a public project
  • Creating your own version of a template or starter project
GitHub fork diagram showing relationship between original and forked repository

How to Fork a Repository

  1. Navigate to the GitHub repository you want to fork
  2. Click the "Fork" button in the top-right corner of the page

    Fork button on GitHub repository page
  3. Select your account as the destination for the fork
  4. Wait for GitHub to create your copy of the repository
  5. You'll be redirected to your new forked repository

Working with a Forked Repository

  1. Clone your forked repository to your computer using GitHub Desktop
  2. Make changes to the code as needed
  3. Commit and push your changes to your fork
  4. To contribute back to the original project, create a pull request (covered in the next section)

Merging Changes

Understanding Merges and Pull Requests

Merging combines changes from one branch into another. This is how you integrate new features or bug fixes into your main codebase.

Pull Requests (PRs) are GitHub's way of proposing changes and requesting that someone review and merge your code. They're essential for collaboration.

GitHub merge diagram showing branches being combined

Merging Branches in GitHub Desktop

  1. In GitHub Desktop, switch to the branch you want to merge into (usually "main")
  2. Click on "Branch" in the top menu, then select "Merge into current branch..."

    Merging branches in GitHub Desktop
  3. Select the branch you want to merge from
  4. Click "Merge [branch] into [current branch]"
  5. Push the changes to GitHub by clicking "Push origin"

Creating a Pull Request

Pull requests are used to propose changes to a repository, especially when contributing to projects you don't own or when working with a team.

  1. Push your branch to GitHub
  2. In GitHub Desktop, click "Create Pull Request" (or go to the repository on GitHub.com)

    Creating a pull request from GitHub Desktop
  3. Your browser will open to GitHub.com with the pull request form
  4. Fill in a title and description explaining your changes
  5. Select the base branch you want to merge into (usually "main")
  6. Click "Create pull request"

Good PR Descriptions Include:

  • What changes you made
  • Why you made them
  • How to test the changes
  • Screenshots (if applicable)
  • Related issues or tickets

PR Review Process:

  • Reviewers examine your code
  • They may leave comments or request changes
  • Address any feedback by pushing new commits
  • Once approved, the PR can be merged

GitHub with AI Tools

Integrating GitHub Across Your AI Development Workflow

GitHub serves as the central hub for your code across different AI development tools. Here's how to integrate GitHub with various tools in the VibeCodex ecosystem:

v0 Logo

v0

  • Export directly to GitHub
  • Fork public v0 projects
  • Create new repositories
  • Add to existing repositories
Cursor Logo

Cursor

  • Clone repositories directly
  • Built-in Git controls
  • Commit, push, and pull
  • Branch management
Replit Logo

Replit

  • Import from GitHub
  • Connect repositories
  • Sync changes
  • Deploy from GitHub

Viewing Projects in GitHub Desktop

After exporting or linking your project with GitHub, you can open and manage it in GitHub Desktop:

  1. Open GitHub Desktop
  2. Click "File" > "Clone Repository"
  3. Select your repository from the list or enter its URL
  4. Choose where to save it on your computer
  5. Click "Clone"
Cloning a repository in GitHub Desktop

Deploying from GitHub

One of the biggest advantages of using GitHub is how easy it makes deploying your projects to the web. Services like Vercel and Netlify connect directly to your GitHub repositories.

Deploying to Vercel

  1. Go to Vercel.com and sign up or log in
  2. Click "Add New..." and select "Project"
  3. Connect your GitHub account if prompted
  4. Select the repository you want to deploy
  5. Configure your project settings (Vercel will auto-detect most frameworks)
  6. Click "Deploy"
Vercel GitHub deployment

Once connected, Vercel will automatically deploy new versions whenever you push changes to GitHub.

When to Transition to Cursor

GitHub serves as the critical bridge between v0 and more advanced development environments like Cursor. While v0 is excellent for initial project creation and simple changes, you'll eventually need to transition to a more powerful tool like Cursor.

Once you've exported your v0 project to GitHub, you're perfectly positioned to continue development in Cursor. Check out our Cursor Basics Guide to learn how to clone your GitHub repository and continue development in a more powerful environment.

Troubleshooting Common Issues

Authentication Failed

Try signing out and back in to GitHub Desktop. If that doesn't work, generate a personal access token on GitHub and use that instead.

Can't Push Changes

Someone else might have pushed changes you don't have. Try pulling first (Fetch origin > Pull origin), resolve any conflicts, then push.

Merge Conflicts

When two people change the same code, you'll need to manually resolve conflicts. GitHub Desktop will show you the conflicts and let you choose which changes to keep.

File Too Large

GitHub has a file size limit of 100MB. For larger files, consider using Git LFS or keeping them out of your repository.

Next Steps

Now that you understand the basics of GitHub, you're ready to take your development workflow to the next level.

Move to Cursor IDE

Learn how to continue your development in Cursor, a powerful AI-assisted code editor perfect for larger projects.

Collaborate with Pull Requests

Learn how to propose changes and review code with teammates using pull requests.

GitHub Issues

Track bugs, enhancements, and tasks using GitHub's built-in issue tracking system.

GitHub Actions

Automate your workflow with custom CI/CD pipelines that run whenever you push code.