I did a git pull from a shared git repository, but something went really wrong, after I tried a git revert. Here is the situation now:
$ git stash
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: needs merge
Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestDS.cxx: needs merge
Utilities/socketxx/socket++/sockstream.cpp: needs merge
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: needs merge
Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestDS.cxx: needs merge
Utilities/socketxx/socket++/sockstream.cpp: needs merge
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: unmerged (2aafac967c35fa4e77c3086b83a3c102939ad168)
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: unmerged (78cc95e8bae85bf8345a7793676e878e83df167b)
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: unmerged (2524db713fbde0d7ebd86bfe2afc4b4d7d48db33)
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: unmerged (4bb4ba78973091eaa854b03c6ce24e8f4af9e7cc)
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: unmerged (ad0982b8b8b4c4fef23e69bbb639ca6d0cd98dd8)
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: unmerged (4868371b7218c6e007fb6c582ad4ab226167a80a)
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: unmerged (f7a1b386b5b13b8fa8b6a31ce1258d2d5e5b13c5)
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: unmerged (6ce299c416fbb3bb60e11ef1e54962ffd3449a4c)
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: unmerged (75c8043a60a56a1130a34cdbd91d130bc9343c1c)
Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestDS.cxx: unmerged (79c2843f2649ea9c87fa57662dafd899a5fa39ee)
...
fatal: git-write-tree: error building trees
Cannot save the current index state
Is there a way to reset all that ?
Thanks
asked Mar 30, 2011 at 7:25
![]()
malatmalat
12.1k13 gold badges87 silver badges156 bronze badges
Use
git reset --mixed
instead of git reset --hard. You will not lose any changes.
answered Apr 17, 2013 at 9:19
heracekheracek
7,2513 gold badges15 silver badges10 bronze badges
6
This worked for me:
Do
$ git status
And check if you have Unmerged paths
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add <file>..." to mark resolution)
#
# both modified: app/assets/images/logo.png
# both modified: app/models/laundry.rb
Fix them with git add to each of them and try git stash again.
git add app/assets/images/logo.png
answered Mar 28, 2014 at 19:37
![]()
David Rz AyalaDavid Rz Ayala
2,1451 gold badge20 silver badges22 bronze badges
4
To follow up on malat’s response, you can avoid losing changes by creating a patch and reapply it at a later time.
git diff --no-prefix > patch.txt
patch -p0 < patch.txt
Store your patch outside the repository folder for safety.
answered Jul 3, 2012 at 19:14
afilinaafilina
8491 gold badge11 silver badges25 bronze badges
2
I used:
git reset --hard
I lost some changes, but this is ok.
answered Mar 30, 2011 at 10:31
![]()
malatmalat
12.1k13 gold badges87 silver badges156 bronze badges
2
maybe there are some unmerged paths in your git repository that you have to resolve before stashing.
Peter Oram
6,1632 gold badges27 silver badges40 bronze badges
answered Sep 15, 2011 at 6:23
npetersnpeters
691 silver badge1 bronze badge
1
This happened to me when trying to merge another branch. The merge failed with fatal: git-write-tree: error building trees and complained about a different file that had nothing to do with the merge. My branch then contained the files it had tried to merge, as uncommitted changes.
I cleared the changes it had attempted to merge, then removed the problem file and rebuilt the hash:
git reset --hard;
git rm --cache problem_file.txt;
git hash-object -w problem_file.txt;
The merge then worked.
answered Mar 22, 2022 at 12:42
BadHorsieBadHorsie
14.1k30 gold badges114 silver badges189 bronze badges
This happened for me when I was trying to stash my changes, but then my changes had conflicts with my branch’s current state.
So I did git reset --mixed and then resolved the git conflict and stashed again.
answered Jul 16, 2019 at 18:06
![]()
mfaanimfaani
32.6k18 gold badges160 silver badges287 bronze badges
I can not commit a change:
$ git commit
error: invalid object 100644 13da9eeff5a9150cf2135aaed4d2e337f97b8114 for 'spec/routing/splits_routing_spec.rb'
error: Error building trees
I tried so far:
$ git fsck | grep 13da
missing blob 13da9eeff5a9150cf2135aaed4d2e337f97b8114
and also:
$ git prune
error: Could not read 1394dce6fd1ad15a70b2f2623509082007dc5b6c
fatal: bad tree object 1394dce6fd1ad15a70b2f2623509082007dc5b6c
and also:
$ git fsck | grep 13da
missing blob 13da9eeff5a9150cf2135aaed4d2e337f97b8114
but nothing helped. Should I delete the file, commit and reintroduce back? I am willing to lose little bit of history if it brings git commit back.
asked Jan 21, 2013 at 22:25
0
This error means that you have a file with hash 13da9eeff5a9150cf2135aaed4d2e337f97b8114, and this hash is not present in .git/objects/../, or it’s empty. When this error occurred, I only had this hash in the error, without the file path. Then I tried to do git gc --auto and git reset --hard. After one of these commands (these commands did not fix my problem), I got the path of the file that triggers the error.
You just need to generate the object hash:
git hash-object -w spec/routing/splits_routing_spec.rb
For more information see documentation. In the documentation, there is an additional way of repairing this error.
P.S.
This was the only way that was helpful for me.
![]()
answered Jul 27, 2016 at 4:46
Alex NikulinAlex Nikulin
8,1044 gold badges34 silver badges37 bronze badges
10
You might have a corrupted object in your git repository.
If you have a remote, or other clones of this repository, you could grab from there the problematic file and just replace it on your local repo.
The file you want would be in:
/repo/.git/objects/13/da9eeff5a9150cf2135aaed4d2e337f97b8114
answered Jan 22, 2013 at 7:40
Maic López SáenzMaic López Sáenz
10.3k4 gold badges44 silver badges57 bronze badges
7
git reset --hard should bring your repository back to normal, but you will lose uncommitted changes.
answered Jan 21, 2013 at 22:27
Tom MacdonaldTom Macdonald
6,3837 gold badges39 silver badges59 bronze badges
3
If the problematic file is being added by your change you can just remove it from the index and add it again:
git reset <file>
git add <file>
answered Mar 3, 2015 at 19:25
ArchiasArchias
1011 silver badge4 bronze badges
1
A simple trick mentioned in this Medium article solved my case where I ran into similar ‘invalid object’ & ‘error building tree’ issues. The solution is pretty straightforward:
git hash-object -w <file-name-which-is-creating-problem>
After that, git will make a Sha1 for the file whose hashes were not matching and its repository will be fixed.
Now I can use git add * and git commit -m without any issues. That’s it.
Note: Create a copy (aka backup) incase if you are not sure what you are doing.
answered May 26, 2022 at 6:13
PranavPranav
2332 silver badges10 bronze badges
1
In my case, I solved it by:
git reset --mixed
![]()
BuZZ-dEE
5,87512 gold badges66 silver badges95 bronze badges
answered Oct 1, 2018 at 9:12
![]()
Sathibabu PSathibabu P
6491 gold badge7 silver badges15 bronze badges
1
For me it was just permissions issue. When I run with sudo, it worked. perhaps something to do with mac environment
![]()
BuZZ-dEE
5,87512 gold badges66 silver badges95 bronze badges
answered Apr 11, 2015 at 19:37
latvianlatvian
3,1519 gold badges33 silver badges62 bronze badges
1
This can be caused by some third-party synchronization APP such as Dropbox and Jianguoyun. There might be two ways based on my experience:
- You can try to undo recent synchronization operations.
- Remove the related files from the folder, commit, and then move back the files.
answered Oct 19, 2017 at 10:20
2
Easy work around solution, if you’re not really concerned on the track of the file, you can duplicate the file and remove the original, commit first the deletion and addition, then rename to original again.
Git should build back again normally
answered Apr 7, 2016 at 10:33
Abd RmdnAbd Rmdn
4704 silver badges11 bronze badges
1
In my case, it is the file in remote branch that is broken.
I solved it by:
- remove the remote branches at all by
$ git remote rm origin - add the remote back again:
$ git remote add origin <the-remote-url> - fetch the remote again:
$ git fetch origin - reset-hard to the desired branch on origin (say,
develop):$ git reset --hard origin/develop
Then everything goes back to normal.
answered Dec 16, 2015 at 7:41
In my case, this was due to a different version of git. I had been using my repository through the official Windows port of git and started using the MinGW port with the same version number.
I started to encounter this issue when trying to commit with MinGW git. Switching back to windows Git solved the issue.
answered Sep 17, 2018 at 1:24
JugheadJughead
7797 silver badges7 bronze badges
it’s as simple as cloning from the remote repo to a new folder, deleting all the files on this new folder keeping the .git one. And then copying all the files from the old folder to the new cloned folder without copying the .git folder..
answered Jun 25, 2021 at 15:27
well I faced this issue also, what i did is: copy changed folder or files to another project in VSCode and delete that repository and clone again and pass that file(s) or folder(s) back again. looks like long way but i think it is better to make sure u won’t lose your files that u didn’t commit yet
answered Oct 5, 2021 at 20:50
![]()
The easiest way to tackle this issue is :
- Copy the uncommit files.
- Then use
$ git reflog -1 - use
$ git reset --hard xxxxxx(xxxxx your last commit head) - Then paste your files again.
It’s worked for me. No need to clone the repo or remove the remote.
answered Dec 11, 2021 at 20:51
UzairUzair
511 silver badge6 bronze badges
git status
and then it shows you which files were modified/causing the issue…
then you can either add them via git add "filename" — without the quotes
or remove via git rm "filename"
answered Apr 10, 2022 at 19:21
A PA P
2,0832 gold badges23 silver badges36 bronze badges
If your repository is synced using OneDrive and none of the above solutions work (git commands result in more errors), it might be a bug with OneDrive app. Suggested solution (which worked for me) is to scan and fix your hard drive:
- Search
Command Promptin the Start menu - Right click on
Command Prompt>Run as administrator - Enter command
chkdsk r f - If chkdsk is unable to scan and fix the drive immediately, it’ll ask to perform the operation during next restart — confirm that you want to scan the drive
answered Sep 29, 2022 at 10:18
I tried the reset command, nothing worked for me except saving my new changes aside, deleting everything re-clone(it dosn’t matter if it’s in new area or same, I used the same) and re-copy
answered Nov 7, 2022 at 22:15
![]()
1
error: invalid object 100644 d5b87de7ffab13b0f9669abceae5c5193ac950ec for 'angular.json'
error: invalid object 100644 d5b87de7ffab13b0f9669abceae5c5193ac950ec for 'angular.json'
error: Error building trees
I faced this issue.
Here’s how I fixed it.
- I cloned the repository again (to get a “fresh” copy)
- I copied the entire
.gitfolder from the cloned repository - Deleted the
.gitfolder from the original repository with the error - Pasted the new
.gitfolder in the original repository
It works!
I hope this will be helpful to someone else!
Zearin
1,4632 gold badges17 silver badges36 bronze badges
answered Aug 20, 2022 at 14:33
Я сделал git pullиз общего репозитория git, но что-то пошло не так после того, как я попыталсяgit revert . Вот ситуация сейчас:
$ git stash
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: needs merge
Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestDS.cxx: needs merge
Utilities/socketxx/socket++/sockstream.cpp: needs merge
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: needs merge
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: needs merge
Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestDS.cxx: needs merge
Utilities/socketxx/socket++/sockstream.cpp: needs merge
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: unmerged (2aafac967c35fa4e77c3086b83a3c102939ad168)
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: unmerged (78cc95e8bae85bf8345a7793676e878e83df167b)
Source/MediaStorageAndFileFormat/gdcmImageCodec.cxx: unmerged (2524db713fbde0d7ebd86bfe2afc4b4d7d48db33)
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: unmerged (4bb4ba78973091eaa854b03c6ce24e8f4af9e7cc)
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: unmerged (ad0982b8b8b4c4fef23e69bbb639ca6d0cd98dd8)
Source/MediaStorageAndFileFormat/gdcmJPEGLSCodec.cxx: unmerged (4868371b7218c6e007fb6c582ad4ab226167a80a)
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: unmerged (f7a1b386b5b13b8fa8b6a31ce1258d2d5e5b13c5)
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: unmerged (6ce299c416fbb3bb60e11ef1e54962ffd3449a4c)
Source/MediaStorageAndFileFormat/gdcmPNMCodec.cxx: unmerged (75c8043a60a56a1130a34cdbd91d130bc9343c1c)
Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestDS.cxx: unmerged (79c2843f2649ea9c87fa57662dafd899a5fa39ee)
...
fatal: git-write-tree: error building trees
Cannot save the current index state
Есть ли способ сбросить все это?
Спасибо
Ответы:
Использование:
git reset --mixed
вместо git reset --hard. Вы не потеряете никаких изменений.
Это сработало для меня:
Делать
$ git status
И проверьте, есть ли у вас Unmerged paths
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add <file>..." to mark resolution)
#
# both modified: app/assets/images/logo.png
# both modified: app/models/laundry.rb
Прикрепите их git addк каждому из них и попробуйте git stashснова.
git add app/assets/images/logo.png
Чтобы следить за реакцией Малата, вы можете избежать потери изменений, создав патч и применив его позже.
git diff --no-prefix > patch.txt
patch -p0 < patch.txt
Храните ваш патч вне папки репозитория для безопасности.
Я использовал:
git reset --hard
Я потерял некоторые изменения, но это нормально.
может быть, в вашем git-репозитории есть несколько незакрепленных путей, которые вы должны решить, прежде чем копировать.
Это произошло для меня, когда я пытался скрыть свои изменения, но затем мои изменения вступили в конфликт с текущим состоянием моей ветви.
Я так git reset --mixedи сделал, а затем решил конфликт с git и снова спрятал.
Я не могу зафиксировать изменения:
$ git commit
error: invalid object 100644 13da9eeff5a9150cf2135aaed4d2e337f97b8114 for 'spec/routing/splits_routing_spec.rb'
error: Error building trees
Я пробовал до сих пор:
$ git fsck | grep 13da
missing blob 13da9eeff5a9150cf2135aaed4d2e337f97b8114
а также:
$ git prune
error: Could not read 1394dce6fd1ad15a70b2f2623509082007dc5b6c
fatal: bad tree object 1394dce6fd1ad15a70b2f2623509082007dc5b6c
а также:
$ git fsck | grep 13da
missing blob 13da9eeff5a9150cf2135aaed4d2e337f97b8114
но ничего не помогло. Должен ли я удалить файл, зафиксировать и повторно ввести обратно? Я готов потерять немного истории, если он вернет git.
Ответ 1
У вас может быть поврежден объект в репозитории git.
Если у вас есть удаленный или другой клон этого репозитория, вы можете получить там проблемный файл и просто заменить его на локальное репо.
Файл, который вы хотите, будет находиться в:
/repo/.git/objects/13/da9eeff5a9150cf2135aaed4d2e337f97b8114
Ответ 2
Эта ошибка означает, что у вас есть файл с hash 13da9eeff5a9150cf2135aaed4d2e337f97b8114, и этот хеш отсутствует в .git/objects/../ или он пуст, когда эта ошибка произошла, у меня есть только этот хеш по ошибке, без пути к файлу, то я попытался сделать git gc --auto и git reset --hard, и после одной из этих команд (эти команды не исправили мою проблему), у меня есть путь к файлу, который вызывает эту ошибку.
Вам нужно просто сгенерировать хэш объекта:
git hash-object -w spec/routing/splits_routing_spec.rb
Для получения дополнительной информации см. документация, в этой документации есть дополнительный способ устранения этой ошибки.
P.S.
Это был единственный способ, который мне помог.
Ответ 3
git reset --hard должен вернуть ваш репозиторий в нормальное состояние, но вы потеряете незафиксированные изменения.
Ответ 4
Если проблемный файл добавляется вашим изменением, вы можете просто удалить его из индекса и добавить его снова:
git reset <file>
git add <file>
Ответ 5
Для меня это были только проблемы с разрешениями. Когда я бегаю с ‘sudo’, это сработало. возможно, что-то связано с mac environmentmnet
Ответ 6
Простота решения проблемы, если вы не очень заинтересованы в отслеживании файла, вы можете дублировать файл и удалять оригинал, сначала зафиксировать удаление и добавление, а затем снова переименовать в оригинал.
Git должен вернуться обратно нормально
Ответ 7
Это может быть вызвано некоторыми сторонними приложениями синхронизации, такими как Dropbox и Jianguoyun. На мой опыт могут быть два пути:
- Вы можете попытаться отменить последние операции синхронизации.
- Удалите связанные файлы из папки, зафиксируйте, а затем верните файлы.
Ответ 8
В моем случае это поврежден файл в удаленной ветке.
Я решил это:
- удалите удаленные ветки вообще
$ git remote rm origin - снова добавьте удаленный компьютер:
$ git remote add origin <the-remote-url> - снова введите пульт дистанционного управления:
$ git fetch origin - reset -hard к нужной ветки по происхождению (скажем,
develop):$ git reset --hard origin/develop
Затем все возвращается к норме.
Я не могу совершить изменение:
$ git commit
error: invalid object 100644 13da9eeff5a9150cf2135aaed4d2e337f97b8114 for 'spec/routing/splits_routing_spec.rb'
error: Error building trees
Я пытался до сих пор:
$ git fsck | grep 13da
missing blob 13da9eeff5a9150cf2135aaed4d2e337f97b8114
а также:
$ git prune
error: Could not read 1394dce6fd1ad15a70b2f2623509082007dc5b6c
fatal: bad tree object 1394dce6fd1ad15a70b2f2623509082007dc5b6c
а также:
$ git fsck | grep 13da
missing blob 13da9eeff5a9150cf2135aaed4d2e337f97b8114
но ничего не помогло. Должен ли я удалить файл, зафиксировать и вернуть обратно? Я готов потерять немного истории, если это вернет git commit.
2013-01-21 22:25
19
ответов
Решение
У вас может быть поврежденный объект в вашем репозитории git.
Если у вас есть удаленный или другие клоны этого репозитория, вы можете получить оттуда проблемный файл и просто заменить его в своем локальном репозитории.
Файл, который вы хотите, будет в:
/repo/.git/objects/13/da9eeff5a9150cf2135aaed4d2e337f97b8114
2013-01-22 07:40
Эта ошибка означает, что у вас есть файл с хэшем 13da9eeff5a9150cf2135aaed4d2e337f97b8114и этого хеша нет в .git/objects/../ или он пустой, когда произошла эта ошибка, у меня есть только этот хэш по ошибке, без пути к файлу, затем я попытался сделать git gc --auto а также git reset --hardи после одной из этих команд (эти команды не устранили мою проблему), я получил путь к файлу, который вызывает эту ошибку.
Вам нужно просто сгенерировать хеш объекта:
git hash-object -w spec/routing/splits_routing_spec.rb
Для получения дополнительной информации см. Документацию, в этой документации есть дополнительный способ исправления этой ошибки.
PS Это был единственный способ, который помог мне.
2016-07-27 04:46
git reset --hard следует вернуть ваш репозиторий в нормальное состояние, но вы потеряете незафиксированные изменения.
2013-01-21 22:27
Если проблемный файл добавляется вашими изменениями, вы можете просто удалить его из индекса и добавить снова:
git reset <file>
git add <file>
2015-03-03 19:25
Для меня это была просто проблема с разрешениями. Когда я бегал с «sudo», это работало. возможно, что-то делать с Mac Environmentmnet
2015-04-11 19:37
В моем случае я решил это следующим образом:
git reset — смешанный
2018-10-01 09:12
Простой трюк, упомянутый в этой статье на Medium, решил мой случай, когда я столкнулся с похожими проблемами «недопустимый объект» и «дерево ошибок при построении». Решение довольно простое:
git hash-object -w <file-name-which-is-creating-problem>
После этого git сделает Sha1 для файла, чьи хэши не совпали, и его репозиторий будет исправлен.
Теперь я могу использовать
git add *а также
git commit -mбез каких-либо проблем. Вот и все.
[Примечание: если у вас есть локальная копия или изменения, которые вам нужны, используйте этот трюк. Потому что вы можете потерять свои локальные изменения. В моем случае я скопировал строку, которую хотел вставить в репозиторий и исправить проблему, а затем повторно отредактировал файл и вставил эту строку.]
2022-05-26 06:13
Это может быть вызвано некоторыми сторонними приложениями для синхронизации, такими как Dropbox и Jianguoyun. На основании моего опыта может быть два пути:
- Вы можете попытаться отменить последние операции синхронизации.
- Удалите связанные файлы из папки, подтвердите, а затем верните файлы назад.
2017-10-19 10:20
Простое решение для обхода, если вы не очень заинтересованы в отслеживании файла, вы можете скопировать файл и удалить оригинал, зафиксировать сначала удаление и добавление, а затем снова переименовать в оригинал.
Git должен вернуться обратно нормально
2016-04-07 10:33
Самый простой способ решить эту проблему:
- Скопируйте незафиксированные файлы.
- Затем используйте
$ git reflog -1 - использовать
$ git reset --hard xxxxxx(xxxxx ваш последний коммит) - Затем снова вставьте файлы.
Это сработало для меня. Нет необходимости клонировать репо или удалять пульт.
2021-12-11 20:51
Если ваш репозиторий синхронизирован с помощью OneDrive и ни одно из вышеперечисленных решений не работает (команды git приводят к большему количеству ошибок), это может быть ошибка в приложении OneDrive . Предлагаемое решение (которое сработало для меня) — отсканировать и исправить ваш жесткий диск:
- Поиск в меню «Пуск»
- Щелкните правой кнопкой мыши
Command Prompt>Run as administrator - Введите команду
chkdsk r f - Если chkdsk не может немедленно отсканировать и исправить диск, он попросит выполнить операцию во время следующего перезапуска — подтвердите, что вы хотите просканировать диск
2022-09-29 10:18
В моем случае, это файл в удаленной ветке, который сломан. Я решил это:
- удалить удаленные ветви вообще
$ git remote rm origin - добавьте пульт снова:
$ git remote add origin <the-remote-url> - получить пульт еще раз:
$ git fetch origin - сбросить на нужную ветку по месту происхождения (скажем,
develop):$ git reset --hard origin/develop
Тогда все возвращается на круги своя.
2015-12-16 07:41
В моем случае это было связано с другой версией git. Я использовал свой репозиторий через официальный порт Windows git и начал использовать порт MinGW с тем же номером версии.
Я начал сталкиваться с этой проблемой при попытке зафиксировать с помощью MinGW git. Переключение обратно на окна Git решило проблему.
2018-09-17 01:24
git hash-object -w spec/routing/splits_routing_spec.rb
После этого git создаст Sha1 для файла.
2020-10-23 20:00
ну, я тоже столкнулся с этой проблемой, что я сделал: скопировал измененную папку или файлы в другой проект в VSCode, удалил этот репозиторий и снова клонировал и снова передал этот файл (ы) или папку (ы) обратно. похоже, долгий путь, но я думаю, что лучше убедиться, что вы не потеряете файлы, которые еще не зафиксировали
2021-10-05 23:50
это так же просто, как клонирование из удаленного репо в новую папку, удаление всех файлов в этой новой папке с сохранением файла .git. А затем скопируйте все файлы из старой папки в новую клонированную папку без копирования папки .git ..
25 июн ’21 в 18:27
2021-06-25 18:27
2021-06-25 18:27
git status
а затем он показывает вам, какие файлы были изменены/вызвали проблему… тогда вы можете либо добавить их через
git add "filename"— без кавычек или удалить через
git rm "filename"
2022-04-10 19:21
Я попробовал команду сброса, у меня ничего не сработало, кроме сохранения моих новых изменений в стороне, удаления всего, повторного клонирования (неважно, в новой области или в том же, я использовал то же самое) и повторного копирования
2022-11-07 22:15
error: invalid object 100644 d5b87de7ffab13b0f9669abceae5c5193ac950ec for 'angular.json'
error: invalid object 100644 d5b87de7ffab13b0f9669abceae5c5193ac950ec for 'angular.json'
error: Error building trees
Я столкнулся с этой проблемой. Вот как я это исправил.
- Я снова клонировал репозиторий (чтобы получить «свежую» копию)
- Я скопировал всю папку из клонированного репозитория
- Удалил папку из оригинального репозитория с ошибкой
- Вставил новый
.gitпапка в оригинальном репозитории
Оно работает!
Я надеюсь, что это будет полезно для кого-то еще!
subin s
20 авг ’22 в 14:33
2022-08-20 14:33
2022-08-20 14:33
Другие вопросы по тегам
git
