← Back to Blog

GitHub for App Developers – Beginner Guide

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

  1. Version Control: Never lose code, revert to previous versions
  2. Backup: Your code is safe in the cloud
  3. Collaboration: Work with teammates without conflicts
  4. Portfolio: Showcase your projects to employers
  5. Open Source: Contribute to and learn from other projects
  6. Job Requirement: Most companies expect Git knowledge

Installing Git

Windows

  1. Download from git-scm.com
  2. Run installer with default settings
  3. Verify: Open Command Prompt, type git --version

Mac

  1. Install Xcode Command Line Tools: xcode-select --install
  2. Or use Homebrew: brew install git
  3. 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

  1. Navigate to your project folder: cd /path/to/your/app
  2. Initialize Git: git init
  3. Add files: git add .
  4. Commit: git commit -m "Initial commit"

Method 2: Clone from GitHub

  1. Create repository on GitHub.com
  2. Copy the repository URL
  3. Clone: git clone https://github.com/username/repo-name.git

Essential Git Commands

Basic Workflow

  • git status - Check what files changed
  • git add filename - Stage specific file
  • git add . - Stage all changes
  • git commit -m "message" - Save changes with description
  • git push - Upload to GitHub
  • git pull - Download latest changes

Viewing History

  • git log - View commit history
  • git log --oneline - Compact view
  • git diff - See what changed

Undoing Changes

  • git checkout -- filename - Discard changes in file
  • git reset HEAD filename - Unstage file
  • git 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 branches
  • git branch feature-name - Create branch
  • git checkout feature-name - Switch to branch
  • git checkout -b feature-name - Create and switch
  • git merge feature-name - Merge branch into current
  • git 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
💡 Best Practice: Never commit directly to main. Always create a feature branch, develop there, then merge when ready.

Working with GitHub

Connecting Local Repo to GitHub

  1. Create repository on GitHub (don't initialize with README)
  2. Add remote: git remote add origin https://github.com/username/repo.git
  3. 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)

  1. Fork the repository (if not a collaborator)
  2. Create a feature branch
  3. Make changes and commit
  4. Push to GitHub
  5. Open Pull Request on GitHub
  6. Team reviews your code
  7. 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
  • .env
  • ios/Pods/

React Native .gitignore Example

  • node_modules/
  • .expo/
  • .env
  • *.log
  • android/app/build/
⚠️ Critical: NEVER commit API keys, passwords, or sensitive data. Always add them to .gitignore!

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

  1. Committing Secrets: API keys, passwords in code
  2. Large Files: Don't commit videos, large assets (use Git LFS)
  3. node_modules/: Never commit dependencies folder
  4. Binary Files: Avoid committing compiled code
  5. Working on Main: Always use feature branches
  6. Vague Commits: "update" tells nothing
  7. 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

  1. Start new feature: git checkout -b feature/new-screen
  2. Make changes and test
  3. Stage: git add .
  4. Commit: git commit -m "Add new user profile screen"
  5. Switch to main: git checkout main
  6. Merge: git merge feature/new-screen
  7. Push: git push origin main
  8. Delete branch: git branch -d feature/new-screen

Git Workflow for Team Projects

  1. Pull latest: git pull origin main
  2. Create branch: git checkout -b feature/login
  3. Make changes and commit regularly
  4. Push branch: git push origin feature/login
  5. Open Pull Request on GitHub
  6. Wait for code review
  7. Address feedback, push updates
  8. Merge when approved

Handling Merge Conflicts

When two people edit the same file:

  1. Git marks conflicts in the file
  2. Open file, look for <<<<<<< markers
  3. Choose which version to keep (or combine both)
  4. Remove conflict markers
  5. Stage: git add filename
  6. 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
🎯 Challenge: Create a GitHub account today, upload your first project, and write a great README. Share your profile in MAD Club's Discord for feedback!

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!