git使用问题-解决方法 备忘
来源:互联网 发布:支持spi的读卡器淘宝 编辑:程序博客网 时间:2024/05/16 16:17
1-- clone分支,修改文件本地commit后, push回原分支失败,报错:
git pushhap@192.168.1.2's password:
Counting objects: 21, done.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 1010 bytes, done.
Total 11 (delta 9), reused 0 (delta 0)
error: refusing to update checked out branch: refs/heads/master
error: By default, updating the current branch in a non-bare repository
error: is denied, because it will make the index and work tree inconsistent
error: with what you pushed, and will require 'git reset --hard' to match
error: the work tree to HEAD.
error:
error: You can set 'receive.denyCurrentBranch' configuration variable to
error: 'ignore' or 'warn' in the remote repository to allow pushing into
error: its current branch; however, this is not recommended unless you
error: arranged to update its work tree to match what you pushed in some
error: other way.
error:
error: To squelch this message and still keep the default behaviour, set
error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To git+ssh://hap@192.168.1.2/media/LINUXDATA/working
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'git+ssh://hap@192.168.1.2/media/LINUXDATA/working'
参照如下链接,目标repo中执行 $ git config 'receive.denyCurrentBranch' warn 后OK
http://stackoverflow.com/questions/2816369/git-push-error-remote-rejected-master-master-branch-is-currently-checked
2-- 新增文件add commit后,push回原分支失败,报错:
Counting objects: 20, done.Delta compression using up to 24 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 1.30 KiB, done.
Total 11 (delta 5), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects
参照如下链接,查看原repo .git目录权限,发现.git/object/没有group写权限导致;执行 $ sudo chmod g+w -R .git/object 后OK
http://stackoverflow.com/questions/6448242/git-push-error-insufficient-permission-for-adding-an-object-to-repository-datab
3-- git clone/git clone --bare/git clone --mirror 区别
http://stackoverflow.com/questions/3959924/whats-the-difference-between-git-clone-mirror-and-git-clone-bare
4-- does not appear to be a git repository
这种问题,权限问题居多,看看整个repo目录 全路径上面用户、组权权限,是否允许访问
- git使用问题-解决方法 备忘
- Git 使用备忘
- git 使用备忘
- git && repo 使用备忘
- git 使用备忘
- Git使用备忘
- Git使用备忘
- Git 使用备忘
- Git工具使用备忘
- Git 使用备忘
- Git使用备忘
- Git 使用备忘
- Git使用问题及解决方法大全
- crontab 不能执行git命令问题备忘
- git&gerrit 使用过程中遇到的问题及解决方法
- git备忘
- git 备忘
- Git 备忘
- 开关中断与cpsid/cpsie指令
- 脚本 make
- strlen函数
- IOS-WKWebView的使用以及Cookie的处理
- 转载别人的面试总结,学习
- git使用问题-解决方法 备忘
- 静态库和动态库详解
- 机械键盘测试——《万历十五年》2
- 趣味取小数
- 查询数据库重复记录方法
- 两个springboot项目如何部署在同一个服务上,two spring boot applications deploy in same server
- Mysql系列(一) 简介
- 【Unity】计时器
- 仿直播间玩色子游戏,AnimatorSet的综合使用