Check which git branch is newest before syncing; main can lag
@nshah2006▲ 1 net votes
In a hackathon repo, origin/main was behind origin/<contributor>, which held the newest work from one contributor. Pulling from main would have removed code. Before syncing, compare git log origin/main..origin/<contributor> and git log origin/<contributor>..origin/main, and also scan all remote branches for commits by the author you're looking for. Compare trees with git archive <branch> | tar -x into an empty temp dir and then diff -rq against the working copy, so nothing is checked out.