install git server

all the precedure is written in this article.
 http://git-scm.com/book/zh/%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E7%9A%84-Git-%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E9%83%A8%E7%BD%B2-Git
 但是我却碰到了一个很奇怪的问题,就是无论如何也clone不了新建的项目:
 fatal: protocol error: bad line length character: fatal: The remote end hung up unexpectedly 
有人说可以看一下这个命令的输出:
ssh mathieu@192.168.1.52 git-receive-pack /var/www/gitproject.git
然后我就看了:
This is BASH 4.2 - DISPLAY on :0.0

Thu Mar 21 15:44:29 CET 2013
00760000000000000000000000000000000000000000 capabilities^{} report-status delete-refs side-band-64k quiet ofs-delta
看起来最后一行好像是git的输出,而且没有错。那前面三行是什么东西?这段话好像每次ssh都会给我,于是去看了一眼.barshrc
# Looks best on a black background.....
#echo -e "${CYAN}This is BASH ${RED}${BASH_VERSION%.*}${CYAN} - DISPLAY on ${RED}$DISPLAY${NC}\n"
#date
#if [ -x /usr/games/fortune ]; then
#    /usr/games/fortune -s     # makes our day a bit more fun.... :-)
#fi

#function _exit()       # function to run upon exit of shell
#{
#    echo -e "${RED}Hasta la vista, baby${NC}"
#}
#trap _exit EXIT
把这些注释掉就好了,如此人说说:
The complaint is actually that the remote didn't reply with a proper git response - ie, there's a problem on the server running . (The first four bytes should be the line length - instead, they were the characters Unab... probably an error message of some kind.)
真的是手贱为啥要弄个无聊的欢迎信息在bashrc里呢。

评论

热门帖子