1

I am using zsh and Oh-My-Zsh on Ubuntu 14.04.

For some reason all directories are indicated to be git repos. This is true for all oh-my-zsh themes, which leads me to believe that this is a zsh issue perhaps related to vcs_info.

  • 1
    Is your home or root directory a git repository? If so, all of its subdirectories will be treated as git repositories as well (at least by git and oh-my-zsh seems to be calling the git executable to display information in the prompt). – Wieland Jul 29 '14 at 9:50
  • 1
    vcs_info uses git rev-parse --is-inside-work-tree to determine if you are currently in a git repository. You can use git rev-parse --git-dir to find out where the .git directory for this repository is. – Adaephon Jul 29 '14 at 11:30
  • Thank you both.I had somehow managed to create a git repo in /. – mac Jul 29 '14 at 11:48
  • 1
    @Networker Do not use code markup for things that are not code. Proper names are not code. – Gilles 'SO- stop being evil' Jul 29 '14 at 21:52
2

Any sub directory to a directory containing a git repo will be identified as a git repo. I had accidentally created a git repo in / which resulted in all directories being identified as git repos.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.