Szymon Toda
Szymon Toda

Reputation: 4516

error: restarting script because .git/FETCH_HEAD changed

I restart node.js server with forever by watchin files. Every few minutes I get message: error: restarting script because .git/FETCH_HEAD changed which restarts my server.

How to avoid that? It shall restart upon file change not git head change.

Watching script:

HOME=/root forever \
    --pidFile $PIDFILE \
    -a \
    -l $LOGFILE \
    --minUptime $MIN_UPTIME \
    --spinSleepTime $SPIN_SLEEP_TIME \
    --watch \
    --watchDirectory=$APPLICATION_PATH \
    start $APPLICATION_PATH$APPLICATION_SCRIPT 2>&1 > /dev/null &
RETVAL=$?
log_end_msg $RETVAL

Upvotes: 9

Views: 733

Answers (2)

Stefan Yohansson
Stefan Yohansson

Reputation: 667

see #20 comment in: https://github.com/foreverjs/forever/issues/235

this problem is not solved in forever, works for many, fail for others. many developers fixed but 'cause is a pull request without tests still not merging yet.

Upvotes: 4

Tristan Foureur
Tristan Foureur

Reputation: 1657

Use the watchIgnore directive to ignore your .git folder, just add this option :

--watchIgnore "**/.git/**"

Upvotes: 6

Related Questions