Git Hooks: GIT_DIR and changing directories

If you’re doing something that needs to change its directory to another place (like say, you have the unfortunate need to call an external repository to perform a subtree merge after your repository has been updated), the variable GIT_DIR needs to be unset for things to work properly.

Do:
unset GIT_DIR
in your bash script to make this happen.

References:
http://www.kernel.org/pub/software/scm/git/docs/howto/rebuild-from-update-hook.txt

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: