简体   繁体   中英

Commit to Submodule from post-commit hook

I am currently trying to update a submodule after committing in my main repository. But git is failing with errors like

fatal: Unable to create '/Users/jhbruhn/georenting-server/GeoRentingServer/georenting-server-endpoint/.git/index.lock': Not a directory

or

fatal: index file open failed: Not a directory

Solved: The Problem was that some Environment-variables were set due to the fact that it was executed by a hook. I reset those in the scripts and now it works:

GIT_DIR=""
GIT_INDEX_FILE=""

I had to use unset

unset GIT_DIR
unset GIT_INDEX_FILE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM