How can you track changes made by others in a shared repository?

Tracking changes made by others in a shared repository means regularly fetching updates from the remote without merging them, then inspecting what's new before deciding to integrate it into your own work.

Key Points: • git fetch downloads new commits and updates remote-tracking branches like origin/main, without touching your working directory or current branch. • git log --branches --not --remotes (or similarly, comparing against origin/main) shows commits others have pushed that you don't have locally yet. • git pull combines fetch and merge in one step, immediately bringing new commits into your current branch. • Visual tools like git log --graph --oneline --all or a GUI client make it easier to see how everyone's branches relate to each other. • Reviewing pull requests and commit messages as they land is a complementary, higher-level way to stay aware of what teammates are changing.

Example: Before starting work each morning, a developer runs git fetch and then git log main..origin/main to see exactly which commits teammates pushed overnight, before deciding whether to pull them in.

Code Example:

git fetch
git log main..origin/main --oneline

Interview Tip: A concise interview answer is:

"I run git fetch regularly to pull down remote updates without merging them, then use git log against the remote-tracking branch to see exactly what's new. Once I know what's changed, I decide when to pull those commits into my own branch."