androidengineers.Book a session

Professional Skills

Git Basics for Developers

article35 minEasy

Git is version control. It tracks changes in your code so you can experiment, review history, collaborate, and recover from mistakes.

Every professional Android developer should be comfortable with Git basics.

The Core Workflow

Most daily Git work follows this flow:

git status
git add .
git commit -m "Add login screen"
git push

git status shows what changed. git add stages changes. git commit saves a snapshot. git push uploads commits to a remote repository.

Branches

Branches let you work without disturbing the main codebase.

git switch -c feature/login-screen

git switch is the modern command for branch operations. git checkout still works but git switch is clearer about intent.

After finishing the work, push the branch and open a pull request.

git push origin feature/login-screen

To switch between existing branches:

git switch main
git switch feature/login-screen

Reading Diffs

Before committing, inspect your changes.

git diff
git diff --staged

This habit catches accidental edits, debug logs, formatting noise, and secrets.

Good Commit Messages

Use messages that explain the change:

  • Add login form validation
  • Fix crash when lesson list is empty
  • Refactor profile screen state

Avoid vague messages like changes, fix, or update.

The .gitignore File

A .gitignore file tells Git which files and folders to never track. Android projects should ignore build outputs, IDE settings, and local config files.

Android Studio creates a .gitignore when you start a project. Make sure it contains at least:

build/
.gradle/
local.properties
*.jks
*.keystore

local.properties contains your local SDK path. Keystore files contain your signing keys. Neither should ever be committed to a shared repository.

Common Beginner Mistakes

MistakeFix
Committing generated build filesUse .gitignore
Huge unrelated commitsCommit focused changes
Not pulling before starting workSync regularly
Ignoring conflictsRead both sides carefully

Practice

Create a branch, edit a README file, commit the change, inspect the log, then create another branch and switch between them.

Summary

Git is part of the job, not an optional tool. Learn status, add, commit, branch, diff, pull, push, and conflict resolution early.

YOUR LEARNING JOURNEY

0 of 22 available lessons completed

Progress saved in this browser. No account needed.
Git Basics for Developers | Junior Android Developer | Android Engineers