GitHub Integration: Complete Guide
Learn how to connect your GitHub repositories and manage code directly from PocketCode on your mobile.
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
- Open Settings in PocketCode
- Go to Integrations → GitHub
- Tap Connect with GitHub
- 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
- Edit files normally
- Changes are automatically marked
- 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
- Make your changes in a branch
- Push the branch
- Tap "Create Pull Request"
- Fill in title and description (and mark it a draft if you want)
- Create the PR
3. Resolve Conflicts
When there are conflicts:
- PocketCode detects them automatically
- Shows files with conflicts
- Open the file
- View differences side by side
- Choose which changes to keep
- 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-namefix/bug-descriptionhotfix/critical-issuerefactor/refactor-name
Before Push
- ✅ Review your changes
- ✅ Run tests (if they exist)
- ✅ Pull before push (avoid conflicts)
- ✅ Write descriptive message
Advanced Configuration
Personal Access Token
PocketCode authenticates to GitHub over HTTPS with a Personal Access Token (PAT):
- Create a token in GitHub Settings → Developer settings → Personal access tokens
- Grant it repository access
- Paste the token into PocketCode when prompted (on GitHub, the token goes in the username field)
- 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
- Open the PR
- See its existing reviews and approval status
- 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:
- Are you in the correct directory?
- Is the repository empty?
- 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! 🚀
Code Editor