# Git & Version Control for App Projects

> Track changes, branch safely and collaborate with Git, including the mobile-specific files you should and should not commit. Free notes, key concepts,...

Canonical: https://www.internhack.in/roadmaps/tracks/mobile/git
Last updated: 2026-11-28

Track changes, branch safely and collaborate with Git, including the mobile-specific files you should and should not commit.

Beginner · about 5 hours · difficulty 2/5

Git records every change to your project so you can experiment without fear, collaborate, and trace when a bug appeared. Every mobile CI/CD pipeline you meet later starts from a Git repository.

### The daily workflow

- `git clone`, `git status`, `git add`, `git commit`, `git push`, `git pull`.
- Create a branch per feature (`git switch -c feature/login`), open a pull request, merge after review.
- Write small commits with clear messages so history is readable.

### Mobile-specific concerns

- Use a proper `.gitignore`: exclude `node_modules`, `build/`, `.gradle`, `Pods/` (team choice), `DerivedData` and local IDE files.
- **Never commit secrets**: keystores, `.p12` certificates, provisioning profiles, API keys and `google-services.json` for production should live in a secret store or CI variables.
- Lock files (`package-lock.json`, `pubspec.lock`, `Podfile.lock`) should be committed so builds are reproducible.
- Tag releases (`v1.4.0`) so you can map store builds back to code.

### Pitfalls

Committing a signing key to a public repo is a real and common mistake; if it happens, rotate the key immediately. Large binary assets bloat the repo; consider Git LFS for big media.

**Good enough to move on:** you can branch, commit, resolve a simple merge conflict and open a pull request on GitHub.

## Key concepts

- **Commits, branches and merges**
- **Remote repositories and pull requests**
- **Resolving merge conflicts**
- **.gitignore for mobile projects**
- **Keeping secrets out of the repo**
- **Release tags**
- **Git LFS for large assets**

## Mini project

Put your hello-world app on GitHub with a correct .gitignore, develop a small change on a branch, and merge it through a pull request.

## Check yourself

Your Android upload keystore was pushed to a public repository. What exactly do you do next?

## Free resources

- [Pro Git book](https://git-scm.com/book/en/v2) (git-scm.com)
- [GitHub Docs: Get started](https://docs.github.com/en/get-started) (GitHub)

Previous: [Development Environment, Emulators & Devices](https://www.internhack.in/roadmaps/tracks/mobile/dev-environment) · Next: [React Native with Expo](https://www.internhack.in/roadmaps/tracks/mobile/react-native-expo)

## More in Orientation: How Mobile Apps Work

- [The Mobile App Landscape](https://www.internhack.in/roadmaps/tracks/mobile/mobile-landscape)
- [Development Environment, Emulators & Devices](https://www.internhack.in/roadmaps/tracks/mobile/dev-environment)
- [Git & Version Control for App Projects](https://www.internhack.in/roadmaps/tracks/mobile/git)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Mobile App Developer Roadmap](https://www.internhack.in/roadmaps/tracks/mobile)
