The issue is finally solved. I have exported some paths for DYLD_LIBRARY_PATH and LD_LIBRARY_PATH in my .bash_profile long time ago which may provide an inconsistent version of some linked library for git. I find this out by trying to compile git from source. And indeed the linking stage of the compilation failed due to a link error related to libiconv , which points me to check my LD flags and settings.