“fatal: not a git repository: '.'” when using post-update hook

转载 2016年06月01日 02:36:39

转自: http://stackoverflow.com/questions/4043609/getting-fatal-not-a-git-repository-when-using-post-update-hook-to-execut

使用 git hooks 脚本执行 git 相关命令时总是 报错: fatal: Not a git repository: '.' , 查了好久都未果,最终在 stack overflow 上找到解决方案了
原因是 环境变量 GIT_DIR 在捣鬼

unset GIT_DIR

#!/bin/sh
cd /path/to/working-copy/ || exit
unset GIT_DIR
git pull origin master

或者
#!/bin/sh
cd /path/to/working-copy/ || exit
env -i git pull origin master

详情参见:

 http://stackoverflow.com/questions/4043609/getting-fatal-not-a-git-repository-when-using-post-update-hook-to-execut

git 中github clone "Permission denied (publickey). fatal: Could not read from remote repository."

第一次使用然后,,出现上述问题解决办法均来自互联网:设置Git的user name和emailgit config –global user.name “yourname” git config –...

git push origin master fatal: 'origin' does not appear to be a git repository fatal: Could not read

在Xcode中push好久都没有反应,然后就给停止了  子啊终端中尝试进行push,结果还是出现错误: git push origin master fatal: 'origin' do...

fatal: Could not read from remote repository.的解决办法

git remote –v查看远端地址或者查看配置 git config –listgit statusgit add . git status git commi...
  • huahua78
  • huahua78
  • 2016年08月26日 18:13
  • 41127

Permission denied (publickey) fatal:Could not read from remote repository

安装了TortoiseGit之后,Eclipse能够克隆提交操作,但是通过文件夹的方式clone却总是报Permission denied (publickey)错误 ,网上找各种资料都没有解决。 ...

github clone "Permission denied (publickey). fatal: Could not read from remote repository."

LZ用git不久,第一次从github clone项目遇见一下问题 $ git clone git@github.com:xiaolongzuo/niubi-job.gitCloning into '...

System.Data.Entity not referenced when using Entity Framework(The type 'System.Data.Objects.DataClas

CS0012: The type 'System.Data.Objects.DataClasses.EntityObject' is defined in an assembly that is no...

Ubuntu 解决:当执行`sudo apt-get update`命令时 出现的 “apt-get 404 Not Found Package Repository Errors” 问题

Ubuntu 解决:当执行`sudo apt-get update`或者`sudo apt-get install`命令是出现的 “apt-get 404 Not Found Package Rep...

git push -u origin master 出错 \Permission denied (publickey). fatal: Could not read from remote repo

在本地写好项目,一路git add * 和 git commit -m 'XXX' 然后在github上新建仓库,准备关联后,把代码推送至远程仓库 在git push 时就出错了: (venv) [w...

【git使用】Permission denied (publickey). fatal: Could not read from remote respository.解决办法

【git使用】Permission denied (publickey). fatal: Could not read from remote respository.解决办法问题描述:执行 $ g...

【Git & GitHub】解决办法:Could not read from remote repository.Please make sure you have the...

问题描述:执行git pull的时候出现下列错误信息 Could not read from remote repository.Please make sure you have the corr...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:“fatal: not a git repository: '.'” when using post-update hook
举报原因:
原因补充:

(最多只允许输入30个字)