Interview Prep/Git & GitHub/Merge and Rebase Problems

`CONFLICT (file/directory): There is a directory with name docs in HEAD. Adding docs as docs~feature instead.`

IntermediateTroubleshootingMerge and Rebase Problems
Answer

Likely causes → One branch has a file called docs, the other has a directory docs/.

Diagnose → git ls-tree HEAD docs and git ls-tree feature docs show which side is the file.

Fix → Choose one layout. Keep the directory and move the stray file: git mv docs~feature docs/README.md (or delete it), then git add and continue.

Prevent → Coordinate repo layout changes and avoid names that turn from file into folder.

All Git & GitHub questions Roadmap: Git & GitHub

More on Merge and Rebase Problems