git 错误 fatal: loose object...is corrupt

错误描述:

error: object file .git/objects/9a/83e9c5b3d697d12a2e315e1777ceaf27ea1bab is empty
fatal: loose object 9a83e9c5b3d697d12a2e315e1777ceaf27ea1bab (stored in .git/objects/9a/83e9c5b3d697d12a2e315e1777ceaf27ea1bab) is corrupt

解决方法:

$ rm -fr .git
$ git init
$ git remote add origin your-git-remote-url
$ git fetch
$ git reset --hard origin/master
$ git branch --set-upstream-to=origin/master master 
时间: 2024-10-29 16:22:05

git 错误 fatal: loose object...is corrupt的相关文章

git 错误 fatal: Not a valid object name: 'master'.

转载:http://blog.csdn.net/jackie_tsai/article/details/51587994 问题场景:新建git项目或刚为已存在项目创建了git仓库,想用git branch dev创建dev分支或用git checkout -b dev创建并切换到dev分支时报错. 原因:刚创建的git仓库默认的master分支要在第一次commit之后才会真正建立,否则就像你声明了个对象但没初始化一样 解决办法:先git add .添加所有项目文件到本地仓库缓存,再git co

git错误fatal: remote origin already exists.

输入 $git remote add origin https://github.com/用户名/项目.git,提示fatal: remote origin already exists.  解决办法: 1 .先输入$ git remote rm origin 2.再输入git remote add origin https://github.com/用户名/项目.git 原文地址:https://www.cnblogs.com/ding-daisy/p/9104548.html

git错误:fatal: Not a git repository (or any of the parent directories): .git

git错误:fatal: Not a git repository (or any of the parent directories): .git 我用git add file添加文件时出现这样错误: fatal: Not a git repository (or any of the parent directories): .git 提示说没有.git这样一个目录,解决办法如下: git init就可以了!

git提交代码出现错误fatal: Unable to create '项目路径/.git/index.lock': File exists.

git提交代码出现错误fatal: Unable to create '项目路径/.git/index.lock': File exists. 具体出错代码如下: 具体原因不详,在stackoverflow上查找了很久,也不清楚原因,但是stackoverflow给出了解决的方法. 解决方法: 在当前项目下打开git bash,运行如下命令: rm -f ./.Git/index.lock 只为成功找方法.大胆的尝试,下一个fun就是你的fun! git提交代码出现错误fatal: Unable

git 提交出现这个错误fatal: Unable to create 'project_path/.git/index.lock': File exists.

git 提交出现这个错误fatal: Unable to create 'project_path/.git/index.lock': File exists. exists 解决办法 rm -f ./.git/index.lock on Windows del .git\index.lock git 提交出现这个错误fatal: Unable to create 'project_path/.git/index.lock': File exists.

git cherry-pick 报错 fatal: bad object

场景:程序员A提交了一个commit到gerrit上,我们叫他为commit_id1,但是还没有review,那就是没有入库,程序员B想再本地拿到这个commitd_id1,既然这个提交没有入库,很明显,B单纯执行git pull是拿不到这个提交的,那他要怎么办呢, 目前我想到的有几种方式:第一种如果只是单纯了改了很少量的文件,我们不排斥程序员A把这几个文件直接发给B.如果改动比较大呢?第二种,程序员A本地关于这个提交生成一个patch,发给B,B再在本地把这个patch打上,这是个不错的方式.

SourceTree不出现用户登录窗口,提示错误fatal: unable to access'...'; error setting certificate verify locations

SourceTree不出现用户登录窗口,提示错误fatal: unable to access'...'; error setting certificate verify locations; ...\Git\mingw64\libexec\ssl\certs 去查看这个这个目录下的文件是否存在,不存在则放到对应的地方即可. SourceTree不出现用户登录窗口,提示错误fatal: unable to access'...'; error setting certificate verif

git 错误:

git  错误: $ git commit -afatal: Unable to create 'e:/git/Android/XXXXXX/.git/index.lock': File exists. If no other git process is currently running, this probably means agit process crashed in this repository earlier. Make sure no other gitprocess is

git错误

1.输入 $ git push -u origin master 命令出现下面错误 $ git push -u 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 reposito 解决办法 $ git