I'm getting the following error on one of our repositorys. I keep deleting the local and checking out a fresh instance and it works for about 10 commits and then it throws the error and keeps me from working. Any thoughts?
here is the error.
fatal: bad object refs/heads/val [conflicted 4] error: https://bitbucket.org/workspace-id/repo.git did not send all necessary objects
[Edit: URL sanitized for privacy]
Hi and welcome to the community!
I ran a git fsck on your repo and there is no corruption on the remote repo. So, the corruption seems to occur on your local repo only. It's hard to say what is causing it, though, as we don't have access to your local clone, and we don't know what operations you are performing.
If you check the references in the directory .git/refs/heads in your local clone, do the file names there match with the names of your branches (when the issue occurs)?
Kind regards,
Theodora
it appears in this folder I have two instances of our staging "val" and they both have bracket title additions [conflicted 4] and [conflicted 5]
Thanks for your help!
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peter,
You may be able to fix this in one of the following two ways (emphasis on "may", as I don't have access to your clone directory and I don't know the state of the rest of the objects). Please take a backup before you proceed (copy the clone directory and paste it elsewhere on that computer), in case these attempts corrupt the repo further.
1. If the branch named val exists on the remote repo, and you did not make locally any additional commits on this branch, and if the currently checked out branch in the clone is different than val, you can try deleting the files .git/refs/heads/val [conflicted 4] and .git/refs/heads/val [conflicted 5].
I also suggest checking the files inside .git/logs/refs/heads to see if there are similar conflicted files in there. If there are, delete these as well.
Then, do a git fetch. If you want to create a local branch val from the remote, you can run
git checkout -b val origin/val
2. Alternatively, you can try fixing the references inside the conflicted files. If you made commits locally on val branch that don't exist on the remote, you need to know the hash of the last commit on val.
First, remove the file .git/refs/heads/val [conflicted 5]. Then, rename the file .git/refs/heads/val [conflicted 4] to .git/refs/heads/val. The content of the val file should be the hash of the latest commit on val branch.
You can try leaving the content of the file .git/refs/heads/val as is or, if this doesn't work, changing it to the content of the file .git/refs/heads/val [conflicted 5] (check your backup).
If there are logs in the folder .git/logs/refs/heads, specifically .git/logs/refs/heads/val, you can also check that file to find the last commit hash on val branch.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@pedrox5 Welcome! You might take a look at this link: https://stackoverflow.com/questions/8788975/bitbucket-git-error-did-not-send-all-necessary-objects
Nicolas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.