Learn how to connect your GitHub repositories and manage code directly from Pocket Code on your mobile.
Managing repositories from mobile used to be complicated. With Pocket Code, it's as easy as on desktop.
Done! Now you can access all your repositories.
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 Pocket Code"
Option C: With Git commands
git clone https://github.com/username/repo.git
# 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:
# View branches
git branch
# Create branch
git checkout -b feature/new-functionality
# Switch branch
git checkout main
# Merge
git merge feature/new-functionality
When there are conflicts:
# After resolving manually
git add conflict-file.js
git commit -m "Resolve conflict in conflict-file.js"
Save changes temporarily:
# Save changes
git stash
# View stashes
git stash list
# Recover changes
git stash pop
# 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
# 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
# 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
β 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
Use descriptive names:
feature/feature-namefix/bug-descriptionhotfix/critical-issuerefactor/refactor-nameTo avoid authenticating every time:
git@github.com:user/repo.gitCreate 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
Automate tasks:
# .git/hooks/pre-commit
#!/bin/sh
npm run lint
npm test
# First pull
git pull origin main
# Resolve conflicts if any
# Then push
git push
Check:
# Verify you pushed
git status
# If it says "Your branch is ahead"
git push
With Pocket Code 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! π