"bad object HEAD" when trying to commit changes to my git repo

No description
97 Replies
CDL
CDLOPā€¢2mo ago
šŸ˜„
No description
b1mind
b1mindā€¢2mo ago
https://ohshitgit.com/ ah gotcha you saw šŸ˜‰
CDL
CDLOPā€¢2mo ago
no matter what i type, that's the response i get
b1mind
b1mindā€¢2mo ago
i like how you just decided to yeet things šŸ˜‚
CDL
CDLOPā€¢2mo ago
I googled a bit, they all said yeet and repeat
b1mind
b1mindā€¢2mo ago
yea idk šŸ˜® I'm a noob with git too xD what did you do before? hah I mean what do you think you did to break it
CDL
CDLOPā€¢2mo ago
Literally nothing :/ I made some changes to my vs code yesterday but i didn't commit them, I just saved the files as I wasn't ready to commit. Log on today, continue editing, finally got to a point of commiting so did my usual "git status" to check, and then got the above
b1mind
b1mindā€¢2mo ago
can you git log
CDL
CDLOPā€¢2mo ago
and now the v2 portfolio isn't recognizing my src folder šŸ¤£ what a fooking day.. anyway it seems the way to fix that is to reset the head, which I tried, didn't work. I then uninstalled and reinstalled git, didn't work
No description
CDL
CDLOPā€¢2mo ago
nope, "bad object head"
b1mind
b1mindā€¢2mo ago
CDL
CDLOPā€¢2mo ago
I mean I've already setup a new github repo and copied the code over, just gotta figure out why the fudging thing isn't recognizing my components and we're gucci
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
https://stackoverflow.com/a/50675088 <-- have you tried this?
Stack Overflow
git status shows fatal: bad object HEAD
I have a problem with git on Windows Azure. Git status shows - "fatal: bad object HEAD" and I tried running: git fsck --full git gc But git fsck shows: broken link from commit
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
git init then git fetch then git status?
CDL
CDLOPā€¢2mo ago
just did it now, it let me do it all, but eventually git status gave the same result
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
or any of the next answers? git remote set-head origin --auto? and then git gc?
CDL
CDLOPā€¢2mo ago
No description
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
or a simple git fetch origin?
CDL
CDLOPā€¢2mo ago
that's a whole lotta shit šŸ˜„
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
so, something went bad bad bad is it in an hdd?
b1mind
b1mindā€¢2mo ago
yea I was about to say something to that effect too seems odd
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
considering it happened twice, im getting very suspicious
CDL
CDLOPā€¢2mo ago
it be in here
No description
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
wait, are you using smb to edit the files? and do all the git stuff?
CDL
CDLOPā€¢2mo ago
any terminal stuff im doing is in vsc in a bash terminal
CDL
CDLOPā€¢2mo ago
No description
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
how are you connecting to the vm?
CDL
CDLOPā€¢2mo ago
it's just WSL
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
with the wsl extension?
CDL
CDLOPā€¢2mo ago
um, not sure if I use an extension? I have the WSL terminal on my windows, I open that, I locate my project folders which is usually
laing91@PCS-PC:~/code/
laing91@PCS-PC:~/code/
, I open VSC and I crack on
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
bottom left corner how does it look like?
b1mind
b1mindā€¢2mo ago
hes asking if VSC is setup for WSL proper
CDL
CDLOPā€¢2mo ago
I guess more accurately its "\wsl.localhost\Ubuntu\home\laing91\code"
No description
CDL
CDLOPā€¢2mo ago
oh
b1mind
b1mindā€¢2mo ago
yes that
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
yes, he's using the right extension
CDL
CDLOPā€¢2mo ago
I'd hope so, b1 helped me set it up like 2 years ago šŸ˜„
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
i've seen people do the weirdest stuff
b1mind
b1mindā€¢2mo ago
damn I've reinstalled like 3 times since then xD
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
is your pc running on an hdd?
CDL
CDLOPā€¢2mo ago
aside from this balls up, why is my new project not accepting my damn components lmao i have a hdd and an ssd i believe my system runs on the hdd, and everything else on the ssd for the most part (I may need to check that, it's been a few years)
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
so, the hdd is the c drive? you can see it by going to "this pc" right-click on c and it should have something there
b1mind
b1mindā€¢2mo ago
oof you really should format and get your OS on that SSD
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
im asking this because it's VERY VERY suspicious that this happened twice to you
CDL
CDLOPā€¢2mo ago
No description
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
how old is the ssd?
CDL
CDLOPā€¢2mo ago
uhh about 2 years I'd say, it was what I added in when I replaced the mobo, gpu, psu, ram
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
have you tried to do a filesystem check on your vm?
CDL
CDLOPā€¢2mo ago
tbh I should just use my damn laptop to code, it has a 2TB samsung SSD... the pc has a 256gb SSD nad a 512gb HHD šŸ˜„
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
256gb is very small
CDL
CDLOPā€¢2mo ago
I've never moved data from an SSD to another, or I'd buy a 2TB SSD on the pc and move it all over
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
if you have a 2nd nvme slot, then you can move the 256gb there, put the 2tb where the 256gb used to be and do a clone then remove the 256gb ssd and reboot then set the boot drive and place the old ssd back and bam!
CDL
CDLOPā€¢2mo ago
tbh there's not a huge amount I have on here that I can't just re-install, the only thing I'd wanna keep is my vscode/wsl configs lol fresh install sounds like a good idea ANYWAY
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
i wouldn't go nuclear yet
CDL
CDLOPā€¢2mo ago
since the initial project is bricked... any idea why this is for some reason bricking too?
No description
b1mind
b1mindā€¢2mo ago
Did you pnmp i
CDL
CDLOPā€¢2mo ago
yep "already up to date"
b1mind
b1mindā€¢2mo ago
Restart
rw
> rw
CDL
CDLOPā€¢2mo ago
oo... it just got a bit buggy then eh
b1mind
b1mindā€¢2mo ago
Language servers and that crap are weird
CDL
CDLOPā€¢2mo ago
my god im so bad at systems, i need to take an evening course or someting lmao well it removed the errors, but now npm run dev literally shows me nothing gota figure that out now
CDL
CDLOPā€¢2mo ago
INTERESTING... it's bricking because it's now svelte 5?
No description
b1mind
b1mindā€¢2mo ago
ya looks like you have dependencies issue now xD
CDL
CDLOPā€¢2mo ago
I mean... just... blegh. There's barely any JS in the project, it's 99% html/css, not sure why there's a dependancy break, unless there's some syntax updates on import
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
have you tried to do what the error message says?
CDL
CDLOPā€¢2mo ago
Trying, it seems to be in here, so it's a vite config issue, perhaps?
No description
CDL
CDLOPā€¢2mo ago
(I should have just made this in sveltekit, tbh)
b1mind
b1mindā€¢2mo ago
yes yes you should npx sv create šŸ˜‰
CDL
CDLOPā€¢2mo ago
ill do that now, see if it still bricks if it does, im done. šŸ˜„ Bruh... I'm like.. beyond overwhelmed with this shit, why'd it have to break šŸ’€ anyway can close this I guess
CDL
CDLOPā€¢2mo ago
How to deal with fatal: bad object HEAD in git
as a cheapo who uses Apple iCloud (the world's worst (https://www.swyx.io/what-to-do-when-icloud-is-stuck-on-uploading-items) sync service) as a sync service for my Obsidian Second Brain (https://www.swyx.io/obsidian-brain), I have recently run into this issue a lot:
CDL
CDLOPā€¢2mo ago
No description
CDL
CDLOPā€¢2mo ago
You have no idea how fucking relieved I am, I was about a minute away from relocating to zimbabwe and living on ants
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
that is interesting
b1mind
b1mindā€¢2mo ago
Don't use syncing in your dev env it never goes well Glad you got it sorted
CDL
CDLOPā€¢2mo ago
what dya mean? (its 2am) wait a fucking minute I'm pushing changes on git but it's not updating my github šŸ˜„
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
check if the origin url is set
CDL
CDLOPā€¢2mo ago
I think I accidentally created a branch?
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
it's possible
CDL
CDLOPā€¢2mo ago
No description
No description
CDL
CDLOPā€¢2mo ago
man I'm confused
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
you can create a local branch
CDL
CDLOPā€¢2mo ago
this'll be it
No description
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
that is a mess also, why are you using the console to do git work instead of vscode's ui?
CDL
CDLOPā€¢2mo ago
Likely caused when it "broke" earlier and I was mashing commands to get it fixed huh, the ui?
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
yes, the ui
CDL
CDLOPā€¢2mo ago
I have a feeling it's still borked, hmm
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
it's possible
CDL
CDLOPā€¢2mo ago
No description
CDL
CDLOPā€¢2mo ago
1 of these has a fatal error on it still
CDL
CDLOPā€¢2mo ago
No description
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
you should sleep
b1mind
b1mindā€¢2mo ago
I mean Swyx starts the article making it sound like iCloud syncing is the issue? or maybe I'm mistaken. But I've heard other people having same issue with anyone of them like OneDrive (but it shouldn't be doing WSL so idk how that is your issue) šŸ¤·ā€ā™‚ļø
CDL
CDLOPā€¢2mo ago
not that I'm aware of mate, I haven't done any syncing manually anyway weird, it's now working? not sure what happened, kinda weird... https://callum-laing.com/ guess I'm learning how to fix broken git shit lol
b1mind
b1mindā€¢2mo ago
growing pains its teh way
CDL
CDLOPā€¢2mo ago
anyway it works, happy days, now I can sleep thanks for the assistance gents!
b1mind
b1mindā€¢2mo ago
You did all the work ! gj gn
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢2mo ago
if i were you, i would make a branch and work on that branch
Want results from more Discord servers?
Add your server