解决GIT [ fatal: Out of memory? mmap failed: No such device ]

 1 # git操作不想每次都输密码,出现报错
 2 [root@api ~]# sudo -u nginx git config --global credential.helper store
 3 error: could not lock config file /home/nginx/.gitconfig: No such file or directory
 4 [root@api ~]# mkdir /home/nginx
 5 [root@api ~]# chown nginx.nginx /home/nginx
 6 [root@api ~]# sudo -u nginx git config --global credential.helper store
 7 fatal: Out of memory? mmap failed: No such device
 8 
 9 # 一通百度、验证之后,发现很多方法都无效;最后尝试升级解决
10 [root@api ~]# git version
11 git version 1.8.3.1
12 [root@api ~]# sudo -u nginx git -C /home/www/web.main pull
13 Unknown option: -C
14 usage: git [--version] [--help] [-c name=value]
15            [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
16            [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
17            [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
18            <command> [<args>]
19 
20 # 升级git
21 [root@api ~]# wget http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm
22 [root@api ~]# rpm -ivh wandisco-git-release-7-2.noarch.rpm
23 [root@api ~]# yum remove -y git
24 [root@api ~]# yum install -y git
25 [root@api ~]# git --version
26 git version 2.31.1
27 
28 # 验证免密
29 [root@api ~]# sudo -u nginx git -C /home/www/server.api pull
30 Username for 'http://gitea.gzxxxxwl.com': xxxx
31 Password for 'http://xxxx@gitea.gzxxxxwl.com': 
32 Already up to date.
33 [root@api ~]# sudo -u nginx git -C /home/www/server.api pull
34 Username for 'http://gitea.gzxxxxwl.com': ^C
35 [root@api ~]# sudo -u nginx git config --global credential.helper store
36 [root@api ~]# sudo -u nginx git -C /home/www/server.api pull
37 Username for 'http://gitea.gzxxxxwl.com': xxxx
38 Password for 'http://xxxx@gitea.gzxxxxwl.com': 
39 Already up to date.
40 [root@api ~]# sudo -u nginx git -C /home/www/server.api pull
41 Already up to date.
42 [root@api ~]#

 

posted @ 2022-09-28 15:04  andy_chan  阅读(410)  评论(0编辑  收藏  举报