centos7本地git仓库操作时遇到的问题及解决方式列表
linux  /  管理员 发布于 3年前   1233
问题1:
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (root@hyperf.(none)')
解决方式:
git config --global user.email "[email protected]"
git config --global user.name "root"
问题2:
[root@hyperf obj]# git push origin master
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决方式:
检查项目根目录.git/config文件 分支主干 没有就补上去 直接把下面的复制也行
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = /home/git/demo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
保存好后 继续执行命令
[root@hyperf obj]# git push origin master
Counting objects: 16251, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (15798/15798), done.
Writing objects: 100% (16251/16251), 27.94 MiB | 1.88 MiB/s, done.
Total 16251 (delta 8430), reused 0 (delta 0)
To /home/git/demo.git
* [new branch] master -> master
问题3:
[root@cdh1 ~]# git clone [email protected]:/home/git/demo.git
Cloning into 'demo'...
[email protected]'s password:
Permission denied, please try again.
[email protected]'s password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决方式:
创建仓库的时候可能没设置git用户密码
到git仓库服务器给git用户设置密码
passwd git用户 123456
问题4:
[root@cdh1 ~]# git clone [email protected]:/home/git/demo.git
fatal: destination path 'demo' already exists and is not an empty directory.
解决方式:
字面意思 目标路径‘demo’已经存在并且不是一个空目录
之前执行命令的时候拉了个有问题的文件夹过来
直接删除掉该文件夹 重新执行命令
[root@cdh1 ~]# git clone [email protected]:/home/git/demo.git
Cloning into 'demo'...
[email protected]'s password:
remote: Counting objects: 16251, done.
remote: Compressing objects: 100% (7368/7368), done.
remote: Total 16251 (delta 8430), reused 16251 (delta 8430)
Receiving objects: 100% (16251/16251), 27.94 MiB | 10.36 MiB/s, done.
Resolving deltas: 100% (8430/8430), done.
Checking out files: 100% (33643/33643), done.
更新中
...
122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..博主 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..1111 在
佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号