Interview Prep/Git & GitHub/Push, Pull and Fetch Errors

`fatal: couldn't find remote ref feature/x` on fetch or pull.

BeginnerTroubleshootingPush, Pull and Fetch Errors
Answer

Likely causes → The branch was deleted or renamed on the remote, or the name is misspelt.

Diagnose →

git ls-remote --heads origin | grep feature
git branch -vv

Fix → Fetch with prune (git fetch --prune), repoint your branch (git branch -u origin/<new-name>) or push it again if it should still exist.

Prevent → Auto-prune with git config --global fetch.prune true.

All Git & GitHub questions Roadmap: Git & GitHub

More on Push, Pull and Fetch Errors