Gitosis: arguments to command look dangerous

If you get the following error when trying to execute git pull: “Arguments to command look dangerous”, then you might want to check whether the remote repository ends with a slash (/). This tripped me and a friend over the other day. Since gitosis is not very verbose with its error-messages, I had to dig deep to find this out.

In general, the path to the git repository needs to start with an alphanumeric character followed by zero or more alphanumeric characters, @, _ or -. Subdirectories have the same restrictions. So, paths cannot end in a slash.

Just edit the corresponding remote section (usually this is origin and the section looks like [remote “origin”]) in the file .git/config and correct the path after the colon (:), for example by removing the slash at the end.

Quoted from here

今天我就碰上了这个错误。gitosis的错误提示实在是太简单了。只能上Google来看有没有前人遇到过这类的问题了。结果运气还不错,直接就找到了根源。如这位大哥所说的,remote中的url最后不要以/结尾就好了。

By Lu Jun

80后男,就职于软件行业。习于F*** GFW。人生48%时间陪同电子设备和互联网,美剧迷,高清视频狂热者,游戏菜鸟,长期谷粉,临时果粉,略知摄影。

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.