Skip to content
Back to home
Back to blog
Tutorial

GitHub Integration: Complete Guide

Learn how to connect your GitHub repositories and manage code directly from PocketCode on your mobile.

5 min
By Pelayo Naredo
GitHub Integration: Complete Guide

Git and GitHub from Your Mobile

Managing repositories from mobile used to be complicated. With PocketCode, it's as easy as on desktop.

Initial Setup

1. Connect Your GitHub Account

  1. Open Settings in PocketCode
  2. Go to Integrations → GitHub
  3. Tap Connect with GitHub
  4. Authorize the application

Done! Now you can access all your repositories.

2. Clone a Repository

There are three ways to clone:

Option A: From the app

1. Tap the "+" button on the home screen
2. Select "Clone Repository"
3. Search or paste the URL
4. Select local location

Option B: From browser

1. Open the repo in GitHub Mobile
2. Tap "Share"
3. Select "Open with PocketCode"

Option C: With Git commands

git clone https://github.com/username/repo.git

Basic Workflow

Make Changes

  1. Edit files normally
  2. Changes are automatically marked
  3. View diff with a tap on the file

Commit and Push

# View status
git status

# Add changes
git add .

# Commit
git commit -m "Fix: correct login bug"

# Push
git push origin main

Or use the visual interface:

  • Tap the Git icon
  • Review changes
  • Write commit message
  • Tap "Commit & Push"

Advanced Features

1. Branch Management

# View branches
git branch

# Create branch
git checkout -b feature/new-functionality

# Switch branch
git checkout main

# Merge
git merge feature/new-functionality

2. Pull Requests

  1. Make your changes in a branch
  2. Push the branch
  3. Tap "Create Pull Request"
  4. Fill in title and description (and mark it a draft if you want)
  5. Create the PR

3. Resolve Conflicts

When there are conflicts:

  1. PocketCode detects them automatically
  2. Shows files with conflicts
  3. Open the file
  4. View differences side by side
  5. Choose which changes to keep
  6. Save and commit
# After resolving manually
git add conflict-file.js
git commit -m "Resolve conflict in conflict-file.js"

4. Stash Changes

Save changes temporarily:

# Save changes
git stash

# View stashes
git stash list

# Recover changes
git stash pop

Common Workflows

Workflow 1: Quick Fix

# 1. Make sure you're on main
git checkout main

# 2. Pull latest changes
git pull

# 3. Make the fix
# ... edit files ...

# 4. Commit and push
git add .
git commit -m "Fix: urgent production bug"
git push

Workflow 2: New Feature

# 1. Create branch from main
git checkout main
git pull
git checkout -b feature/new-api

# 2. Develop
# ... implement the feature ...

# 3. Frequent commits
git add .
git commit -m "feat: add /api/users endpoint"

# 4. Push and create PR
git push -u origin feature/new-api
# Then create PR from the app

Workflow 3: Hotfix

# 1. Branch from production
git checkout production
git checkout -b hotfix/critical-bug

# 2. Quick fix
# ... fix ...

# 3. Commit and direct merge
git add .
git commit -m "hotfix: fix critical error"
git checkout production
git merge hotfix/critical-bug
git push

Best Practices

Commits

Good messages:

feat: add Google login
fix: correct email validation
docs: update README with instructions
refactor: simplify search function

Bad messages:

changes
fix
wip
asdfgh

Branches

Use descriptive names:

  • feature/feature-name
  • fix/bug-description
  • hotfix/critical-issue
  • refactor/refactor-name

Before Push

  1. ✅ Review your changes
  2. ✅ Run tests (if they exist)
  3. ✅ Pull before push (avoid conflicts)
  4. ✅ Write descriptive message

Advanced Configuration

Personal Access Token

PocketCode authenticates to GitHub over HTTPS with a Personal Access Token (PAT):

  1. Create a token in GitHub Settings → Developer settings → Personal access tokens
  2. Grant it repository access
  3. Paste the token into PocketCode when prompted (on GitHub, the token goes in the username field)
  4. Use HTTPS URLs: https://github.com/user/repo.git

.gitignore

Create a .gitignore to ignore files:

# Dependencies
node_modules/
venv/
__pycache__/

# Build outputs
dist/
build/
*.pyc

# Environment
.env
.env.local

# IDE
.vscode/
.idea/

# OS
.DS_Store
Thumbs.db

Git Hooks

Automate tasks:

# .git/hooks/pre-commit
#!/bin/sh
npm run lint
npm test

Collaboration

Code Review from Mobile

  1. Open the PR
  2. See its existing reviews and approval status
  3. Add a comment to the PR conversation

Submitting a formal approve/request-changes review, and line-anchored comments, aren't wired into the app yet — do those from GitHub's web UI. What PocketCode shows today is the PR's review state and conversation.

Discussions

  • Reply to comments
  • Mention collaborators with @username
  • Use emojis for quick reactions

Troubleshooting

"Can't push"

# First pull
git pull origin main

# Resolve conflicts if any
# Then push
git push

"I cloned the repo but don't see files"

Check:

  1. Are you in the correct directory?
  2. Is the repository empty?
  3. Are there errors in the log?

"Changes don't appear on GitHub"

# Verify you pushed
git status

# If it says "Your branch is ahead"
git push

Conclusion

With PocketCode you have the full power of Git and GitHub on your mobile. No more excuses for not making that urgent commit.

Next tutorial: Automatic deploy from GitHub with Vercel

Questions? Join our Discord

Happy coding! 🚀

The tool behind this article

Code Editor

Ready to try PocketCode?

Download the app and start coding from your mobile.