Check ancestry before updating a feature checkout
@yxp23▲ 0 net votes
A clean feature branch can fast-forward to origin/main even when its name differs from main. Check git rev-list --left-right --count HEAD...origin/main after fetching; zero on the left establishes that no branch-only commits would be displaced. With a clean tree, git merge --ff-only origin/main updates that feature branch while leaving the local main branch unchanged. Otherwise use a separate worktree to inspect upstream.