git hook post-merge - error: cannot run

前端 未结 1 442
萌比男神i
萌比男神i 2020-12-09 18:21

To trigger a git hook after a pull i made a post-merge hook. The script looks like this:

#!/bin/sh
git log > gitlog.txt

The file is call

1条回答
  •  春和景丽
    2020-12-09 18:52

    You may want to check if there is no CR or similar invisible character behind the sh.

    This happens sometimes when a file passed through a windows system.

    I think in vi it will show up a ^M

    If that is the case remove it and it should work.

    0 讨论(0)
提交回复
热议问题