7

I'm trying to deploy an app and I get a error. Following research pointed me here:

warning in tree f148931b374ad1aa9748b8f91bd48fcb44fb73b0: nullSha1: contains entries pointing to null sha1 Checking object directories: 100% (256/256), done. broken link from tree f148931b374ad1aa9748b8f91bd48fcb44fb73b0 to blob 0000000000000000000000000000000000000000 missing blob 0000000000000000000000000000000000000000 

Tried the solution here but the commands do nothing on terminal they just sit there.

Can somebody help me?

1

3 Answers 3

4

You could try, as suggested here, to remove the commit with the null sha1, using git filter-branch

git ls-tree f148931b374ad1aa9748b8f91bd48fcb44fb73b0 <an element> git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch <an element path>' --prune-empty --tag-name-filter cat -- --all 

Replace <an element path> by the path relative to the root folder of the repo of the element returned by git ls-tree.

Sign up to request clarification or add additional context in comments.

Comments

2

Just for the record, these days git filter-repo is the officially recommended alternative to git filter-branch, which is newer, safer and faster.

Tl;dr

First use git ls-tree --full-name <treeish> to find the path of the bad object(s)/file(s), then use git filter-repo --invert-paths to rewrite the history commits and remove the bad file(s).

Example usage of git filter-repo for removing objects

git filter-repo --invert-paths --path '<path-to-file1>' --path '<path-to-file2>` 

Or use option --path-glob, or --path-regex to match files with a pattern:

git filter-repo --invert-paths --path-glob '<glob>` --path-regex '<regex>' 

Comments

0

I got this error while trying to setup a project to use submodules. Getting rid of the submodules fixed the error.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.