犯了一个低级错误:

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. 20175214 《Java程序设计》第11周学习总结

    20175214 <Java程序设计>第11周学习总结 本周学习任务总结 1.根据<java2实用教程>和蓝墨云学习视频学习第十三章: 2.尝试将课本重点内容用自己的话复述手打 ...

  2. 通过HookNtCreateSection 动态监控驱动sys、动态链接库dll、可执行文件exe加载

    [cpp] view plaincopyprint? /* windows2003 x86/x64 window7 x86 windows2008 R2 x64测试通过 */ #include < ...

  3. linux的find和grep区别?

    为什么会把 grep和find 这两个命令拿在一起来讨论? 是因为他们之间有一个容易混淆的地方, [在我的记忆中] : -name ? 它是find的选项! 不是grep的选项! 实际上, find基 ...

  4. 【C++】fill函数,fill与memset函数的区别

    转载自:https://blog.csdn.net/liuchuo/article/details/52296646 memset函数 按照字节填充某字符在头文件<cstring>里面fi ...

  5. 【tensorflow使用笔记一】:安装linux下tensorflow环境的问题

    首先安装Python Python2.7 使用pip安装Python-numpy发现有老版本影响import直接手动删除: 安装default-jdk顺利: 安装matplotlib发现没有tkint ...

  6. LinkedHashSet 源码分析

    LinkedHashSet 1)底层由 LinkedHashMap 支持的 Set 接口实现,该 Set 中的元素具有可预知的迭代顺序. 创建实例 /** * 构造一个新的空 set,其底层 Link ...

  7. 16/7/7_PHP-面向对象关键词

    转载地址: http://blog.sina.com.cn/s/blog_5182b171010092fb.html PHP5 是一具备了大部分面向对象语言的特性的语言,比PHP4 有了很多的面向对象 ...

  8. Python笔记(二十九)_模块

    模块 在Python中,一个.py文件就是一个模块 if __name__ == '__main__':所有模块都有一个 __name__ 属性,__name__ 的值取决于如何应用模块 run当前文 ...

  9. 【ABAP系列】SAP ABAP ALV里日期类型的F4帮助

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP系列]SAP ABAP ALV里日期类 ...

  10. React-onsenui之RouterNavigator组件解读

    var index = 1;// index的最外层初始值,亦是全局 var MyPage = React.createClass({ //构成工具栏组件,根据hasBackButton的值为back ...