GitHub is essential for modern app development. Whether you're working solo or in a team, understanding Git and GitHub will save you from code disasters, help you collaborate effectively, and make you more attractive to employers. This guide covers everything you need to know as a mobile app developer.
What is Git vs GitHub?
- Git: Version control system that tracks changes in your code (runs on your computer)
- GitHub: Cloud platform for hosting Git repositories (online storage + collaboration features)
Think of Git as Microsoft Word's "Track Changes" feature, and GitHub as Google Drive for code.
Why App Developers Need GitHub
- Version Control: Never lose code, revert to previous versions
- Backup: Your code is safe in the cloud
- Collaboration: Work with teammates without conflicts
- Portfolio: Showcase your projects to employers
- Open Source: Contribute to and learn from other projects
- Job Requirement: Most companies expect Git knowledge
Installing Git
Windows
- Download from
git-scm.com - Run installer with default settings
- Verify: Open Command Prompt, type
git --version
Mac
- Install Xcode Command Line Tools:
xcode-select --install - Or use Homebrew:
brew install git - Verify:
git --version
Linux
- Ubuntu/Debian:
sudo apt-get install git - Fedora:
sudo dnf install git
Setting Up Git
Configure your identity (one-time setup):
git config --global user.name "Your Name"git config --global user.email "your.email@example.com"git config --global init.defaultBranch main
Creating Your First Repository
Method 1: Start Locally
- Navigate to your project folder:
cd /path/to/your/app - Initialize Git:
git init - Add files:
git add . - Commit:
git commit -m "Initial commit"
Method 2: Clone from GitHub
- Create repository on GitHub.com
- Copy the repository URL
- Clone:
git clone https://github.com/username/repo-name.git
Essential Git Commands
Basic Workflow
git status- Check what files changedgit add filename- Stage specific filegit add .- Stage all changesgit commit -m "message"- Save changes with descriptiongit push- Upload to GitHubgit pull- Download latest changes
Viewing History
git log- View commit historygit log --oneline- Compact viewgit diff- See what changed
Undoing Changes
git checkout -- filename- Discard changes in filegit reset HEAD filename- Unstage filegit revert commit-hash- Undo a commit safely
Branching: The Superpower
Branches let you work on features without breaking your main code.
Branch Commands
git branch- List branchesgit branch feature-name- Create branchgit checkout feature-name- Switch to branchgit checkout -b feature-name- Create and switchgit merge feature-name- Merge branch into currentgit branch -d feature-name- Delete branch
Branching Strategy for Apps
- main: Production-ready code
- develop: Latest development code
- feature/login: New login feature
- bugfix/crash-on-startup: Bug fixes
Working with GitHub
Connecting Local Repo to GitHub
- Create repository on GitHub (don't initialize with README)
- Add remote:
git remote add origin https://github.com/username/repo.git - Push:
git push -u origin main
Cloning Existing Projects
git clone https://github.com/username/repo.git- Navigate into folder:
cd repo - Start working!
Collaboration Workflow
Pull Requests (PRs)
- Fork the repository (if not a collaborator)
- Create a feature branch
- Make changes and commit
- Push to GitHub
- Open Pull Request on GitHub
- Team reviews your code
- Merge when approved
Code Review Best Practices
- Write clear PR descriptions
- Keep PRs small and focused
- Respond to feedback professionally
- Test before requesting review
The .gitignore File
Tell Git which files to ignore (sensitive data, build files, etc.)
Flutter .gitignore Example
.dart_tool/build/*.iml.envios/Pods/
React Native .gitignore Example
node_modules/.expo/.env*.logandroid/app/build/
Writing Good Commit Messages
Bad Examples
- "fixed stuff"
- "asdfasdf"
- "update"
Good Examples
- "Add user authentication with Firebase"
- "Fix crash when loading empty list"
- "Update UI colors to match brand guidelines"
- "Refactor database queries for better performance"
Commit Message Format
- Use present tense: "Add feature" not "Added feature"
- Be specific and descriptive
- Keep first line under 50 characters
- Add detailed description if needed (after blank line)
GitHub Features for Developers
README.md
Your project's front page. Include:
- Project description
- Screenshots/demo
- Installation instructions
- Usage examples
- Technologies used
- License
Issues
- Track bugs and feature requests
- Assign to team members
- Label by priority/type
- Link to PRs that fix them
GitHub Actions (CI/CD)
- Automatically run tests on every commit
- Build and deploy your app
- Check code quality
GitHub Pages
- Host project documentation
- Create portfolio website
- Free static site hosting
Common Mistakes to Avoid
- Committing Secrets: API keys, passwords in code
- Large Files: Don't commit videos, large assets (use Git LFS)
- node_modules/: Never commit dependencies folder
- Binary Files: Avoid committing compiled code
- Working on Main: Always use feature branches
- Vague Commits: "update" tells nothing
- Huge Commits: Commit frequently, not once per week
GitHub for Your Portfolio
Making Your Profile Stand Out
- Pin your best 6 repositories
- Write detailed README files
- Add screenshots and demos
- Contribute to open source projects
- Maintain consistent commit activity
- Use GitHub Profile README (special repo with your username)
What Employers Look For
- Quality over quantity (3 great projects > 20 mediocre ones)
- Clean, well-documented code
- Regular commits (shows consistency)
- Meaningful commit messages
- Contributions to open source
- Diverse tech stack
Git Workflow for Solo Projects
- Start new feature:
git checkout -b feature/new-screen - Make changes and test
- Stage:
git add . - Commit:
git commit -m "Add new user profile screen" - Switch to main:
git checkout main - Merge:
git merge feature/new-screen - Push:
git push origin main - Delete branch:
git branch -d feature/new-screen
Git Workflow for Team Projects
- Pull latest:
git pull origin main - Create branch:
git checkout -b feature/login - Make changes and commit regularly
- Push branch:
git push origin feature/login - Open Pull Request on GitHub
- Wait for code review
- Address feedback, push updates
- Merge when approved
Handling Merge Conflicts
When two people edit the same file:
- Git marks conflicts in the file
- Open file, look for
<<<<<<<markers - Choose which version to keep (or combine both)
- Remove conflict markers
- Stage:
git add filename - Commit:
git commit -m "Resolve merge conflict"
Learning Resources
Interactive Tutorials
- GitHub Learning Lab: Free interactive courses
- Learn Git Branching: Visual, interactive tutorial
- Git-it: Desktop app for learning Git
Documentation
- Official Git Docs: git-scm.com/doc
- GitHub Docs: docs.github.com
- Atlassian Git Tutorials: atlassian.com/git
GitHub Alternatives
While GitHub is most popular, alternatives exist:
- GitLab: More features, built-in CI/CD
- Bitbucket: Good for Atlassian ecosystem
- Gitea: Self-hosted, open source
However, for students and job seekers, GitHub is the standard.
MAD Club GitHub Best Practices
At MAD Club, we teach:
- Git fundamentals in every workshop
- Collaborative workflows in team projects
- Code review practices
- Building impressive GitHub portfolios
- Contributing to open source
Conclusion
GitHub is more than just a backup tool—it's your professional portfolio, collaboration platform, and learning resource. Master Git and GitHub early in your development journey, and it will serve you throughout your career.
Start small: commit your current project, write a README, and push to GitHub. As you build more apps, your GitHub profile becomes a powerful showcase of your skills and growth as a developer.
Remember: every expert developer uses version control. The sooner you start, the more natural it
becomes. Don't be intimidated—everyone starts with git init!
Ready to level up your development workflow? Check our Resources page for Git tutorials, or join MAD Club's workshops to learn collaborative development!