犯了一个低级错误:

server ip: 192.168.40.41

有一个git账户

所有的git仓库都在/home/git仓库下

比如/home/git/u-boot-2018.07-fmxx.git

我用了以下命令:

git clone 192.168.40.41:/home/git/u-boot-2018.07-fmxx.git

改过一些东西后,发现git push不上去

而且git clone时候输入的是我的账户密码,并不是git的密码

然后让同事帮忙看了一下:

git remote -v

origin  192.168.40.41:/home/git/u-boot-2018.07-fmxx.git (fetch)
origin  192.168.40.41:/home/git/u-boot-2018.07-fmxx.git (push)

git remote -h

可以显示命令的用法。

git remote set-url [--push] <name> <newurl> [<oldurl>]

git remote set-url origin git@192.168.40.41:/home/git/u-boot-2018.07-fmxx.git/

就是将<name>为origin的的新url设置为git@192.168.40.41:/home/git/u-boot-2018.07-fmxx.git/

所以git@192.168.40.41:/home/git/u-boot-2018.07-fmxx.git/的意思是:

git表示git用户,意思就是git用户艾特在192.168.40.41上,目录/home/git/u-boot-2018.07-fmxx.git/下的仓库。

这时候push pull 都是git的密码了,能成功。

我又新建了一个仓库,/home/zhangyi/tmp

git init --bare #建立了一个裸仓库

git clone 192.168.40.41:/home/zhangyi/tmp

#这样可以push 因为是同一个用户吧,后来用其他用户git clone 不加zhangyi@,出现了不能push的错误

error: remote unpack failed: unable to create temporary object directory
To 192.168.40.41:/home/zhangyi/tmp
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to '192.168.40.41:/home/zhangyi/tmp'

git remote -v

origin  192.168.40.41:/home/zhangyi/tmp (fetch)
origin  192.168.40.41:/home/zhangyi/tmp (push)

在其他用户下

git clone zhangyi@192.168.40.41:/home/zhangyi/tmp

需要输入zhangyi的密码,可以正常push pull。

git clone的低级错误的更多相关文章

  1. git clone出现SSL错误

    在学习git的时候,发现不能使用git clone从github.com下载,报了个ssl错误. Cloning into cancan... error: SSL certificate probl ...

  2. 升级了git版本后git clone报ssl错误的解决方法

    由于升级了git版本,git clone 的时候报了如下的错误 fatal: unable to access 'https://github.com/open-falcon/falcon-plus. ...

  3. git clone时,报403错误,完美解决方案

    首先命令行操作结果如下: root@zhiren-PowerEdge-T110-II:/zrun# git clone https://git.coding.net/xxxxxxxx/xxxx.git ...

  4. git clone错误

    git clone错误 Initialized empty Git repository in ***/.git/ error: The requested URL returned error: 4 ...

  5. git clone 出现 RPC failed 错误的解决方案

    今天使用git clone一个大型项目的时候出现了如下错误:

  6. git clone操作到开发机的错误记录

    在开发机上,执行操作 $ git clone https://github.com/xxx/rank.git 返回错误: error: The requested URL returned error ...

  7. git clone错误 fatal: early EOF fatal: index-pack failed

    最后用ssh的方式解决了,不用http https://blog.csdn.net/fastjack/article/details/79757520 用了以下的方法还是不行 今天想 clone 一下 ...

  8. git clone的时候报error: RPC failed; result=18错误

    因业务需求,需要把内网gitlab仓库的地址对外网访问,在gitlab前端配置了一个nginx代理服务器,来实现需求,可以在git clone的时候报error: RPC failed错误 [root ...

  9. 从coding.net 克隆(git clone)项目代码到本地报无权限(403)错误 解决方案

    直接从coding.net (git clone)项目代码到本地时,会提示没有权限的错误,如下图: 解决方案:添加远程地址的时候带上用户名及密码即可解决,格式如下: git clone http:// ...

随机推荐

  1. tree 命令

    LMXMN117:Mac Driver will.wei$ tree -N >/tmp/savs.txt       (1)tree -a 显示所有文件和目录   (2)tree -d 显示目录 ...

  2. UITextView输入中文时限制字数

    最近因为项目中输入用户简称时限制长度,被测试部多次提交问题,最终将解决方法分享给大家. 刚开始用最简单的方法,在textView的代理方法里面做处理 - (void)textViewDidChange ...

  3. PHP文件和目录操作

    目录操作 创建目录:mkdir(目录地址, 权限, 是否递归创建=false); 删除目录:rmdir(目录地址);(仅仅可以删除空目录,不支持递归删除) 移动(改名):rename(旧地址, 新地址 ...

  4. Ajax,学习教程!

    一.什么是Ajax? 2005 年Jesse James Garrett 发表了一篇文章,标题为:“Ajax:A new Approach to Web Applications”.他在这篇文章里介绍 ...

  5. SpringBoot系列:三、SpringBoot中使用Filter

    在springboot中要使用Filter首先要实现Filter接口,添加@WebFilter注解 然后重写三个方法,下图示例是在Filter中过滤上一届中拿配置的接口,如果是这个接口会自动跳转到/P ...

  6. 008-Spring Boot @EnableAutoConfiguration深入分析、内部如何使用EnableAutoConfiguration

    一.EnableAutoConfiguration 1.EnableAutoConfiguration原理 springboot程序入口使用注解@SpringBootApplication,Sprin ...

  7. laravel使用artisan报错SQLSTATE[42S02]: Base table or view not found: 1146

    说明你在应用初始化阶段使用到了数据库层面的东西,然而当时数据库不存在这个表/字段,所以会报错 需要在初始化比如 config 目录配置中,使用了数据库,在使用前需要添加一层判断,如果不存在 你需要用到 ...

  8. Python解决NameError: name 'reload' is not defined的问题

    遇到这个问题,对于 Python 2.X: import sys reload(sys) sys.setdefaultencoding("utf-8") 对于 Python 3.3 ...

  9. Mac017--Jenkins 持续集成

    Jenkins 是一个开源项目,提供了一种易于使用的持续集成系统,使开发者从繁杂的集成中解脱出来,专注于更为重要的业务逻辑实现上.同时 Jenkins 能实施监控集成中存在的错误,提供详细的日志文件和 ...

  10. mysql 函数 时间函数,数学函数,字符串函数,条件判断函数

    =========================================== mysql 相关函数 ============================================= ...