I am using zsh on an Ubuntu 16.04
Since today I have not been able to use the cd command. Whenever I try to change my directory from the terminal I get this error fatal: Not a git repository (or any of the parent directories): .git
I took a look at my .zshrc
to see if an alias might have changed cd
to a git
command, but I couldn't find any.
I was making some changes to my .zshrc
today and I did see an error message after making those changes and reloading the shell but I ingored it and once I changed my config back to the way it was and I reloaded the shell the error/warning went away but after that I noticed that cd wasn't working.
Is there a way I can see or trace what program a unix command is hitting so that I can get to the root of this problem
EDIT: My zsh autocomplete works with cd but when I press enter I get this error.
This is the output of which cd
cd () {
if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]
then
git push origin "${*}"
else
[[ "$#" = 0 ]] && local b="$(git_current_branch)"
git push origin "${b:=$1}"
fi
}
You can try to check what is linked to cd with this command
which cd
If the setup is standard, you should get this message:
cd: shell built-in command
If it's not the case then you can see what causes the problem.
If you are using oh-my-zsh, this can come from it too since it's a git-based project.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments