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

No description
97 Replies
CDL
CDLOPā€¢5w ago
šŸ˜„
No description
b1mind
b1mindā€¢5w ago
https://ohshitgit.com/ ah gotcha you saw šŸ˜‰
CDL
CDLOPā€¢5w ago
no matter what i type, that's the response i get
b1mind
b1mindā€¢5w ago
i like how you just decided to yeet things šŸ˜‚
CDL
CDLOPā€¢5w ago
I googled a bit, they all said yeet and repeat
b1mind
b1mindā€¢5w 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ā€¢5w 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ā€¢5w ago
can you git log
CDL
CDLOPā€¢5w 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ā€¢5w ago
nope, "bad object head"
b1mind
b1mindā€¢5w ago
CDL
CDLOPā€¢5w 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
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w 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
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
git init then git fetch then git status?
CDL
CDLOPā€¢5w ago
just did it now, it let me do it all, but eventually git status gave the same result
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
or any of the next answers? git remote set-head origin --auto? and then git gc?
CDL
CDLOPā€¢5w ago
No description
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
or a simple git fetch origin?
CDL
CDLOPā€¢5w ago
that's a whole lotta shit šŸ˜„
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
so, something went bad bad bad is it in an hdd?
b1mind
b1mindā€¢5w ago
yea I was about to say something to that effect too seems odd
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
considering it happened twice, im getting very suspicious
CDL
CDLOPā€¢5w ago
it be in here
No description
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
wait, are you using smb to edit the files? and do all the git stuff?
CDL
CDLOPā€¢5w ago
any terminal stuff im doing is in vsc in a bash terminal
CDL
CDLOPā€¢5w ago
No description
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
how are you connecting to the vm?
CDL
CDLOPā€¢5w ago
it's just WSL
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
with the wsl extension?
CDL
CDLOPā€¢5w 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
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
bottom left corner how does it look like?
b1mind
b1mindā€¢5w ago
hes asking if VSC is setup for WSL proper
CDL
CDLOPā€¢5w ago
I guess more accurately its "\wsl.localhost\Ubuntu\home\laing91\code"
No description
CDL
CDLOPā€¢5w ago
oh
b1mind
b1mindā€¢5w ago
yes that
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
yes, he's using the right extension
CDL
CDLOPā€¢5w ago
I'd hope so, b1 helped me set it up like 2 years ago šŸ˜„
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
i've seen people do the weirdest stuff
b1mind
b1mindā€¢5w ago
damn I've reinstalled like 3 times since then xD
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
is your pc running on an hdd?
CDL
CDLOPā€¢5w 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)
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w 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ā€¢5w ago
oof you really should format and get your OS on that SSD
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
im asking this because it's VERY VERY suspicious that this happened twice to you
CDL
CDLOPā€¢5w ago
No description
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
how old is the ssd?
CDL
CDLOPā€¢5w ago
uhh about 2 years I'd say, it was what I added in when I replaced the mobo, gpu, psu, ram
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
have you tried to do a filesystem check on your vm?
CDL
CDLOPā€¢5w 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 šŸ˜„
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
256gb is very small
CDL
CDLOPā€¢5w 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
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w 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ā€¢5w 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
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
i wouldn't go nuclear yet
CDL
CDLOPā€¢5w ago
since the initial project is bricked... any idea why this is for some reason bricking too?
No description
b1mind
b1mindā€¢5w ago
Did you pnmp i
CDL
CDLOPā€¢5w ago
yep "already up to date"
b1mind
b1mindā€¢5w ago
Restart
rw
> rw
CDL
CDLOPā€¢5w ago
oo... it just got a bit buggy then eh
b1mind
b1mindā€¢5w ago
Language servers and that crap are weird
CDL
CDLOPā€¢5w 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ā€¢5w ago
INTERESTING... it's bricking because it's now svelte 5?
No description
b1mind
b1mindā€¢5w ago
ya looks like you have dependencies issue now xD
CDL
CDLOPā€¢5w 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
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
have you tried to do what the error message says?
CDL
CDLOPā€¢5w ago
Trying, it seems to be in here, so it's a vite config issue, perhaps?
No description
CDL
CDLOPā€¢5w ago
(I should have just made this in sveltekit, tbh)
b1mind
b1mindā€¢5w ago
yes yes you should npx sv create šŸ˜‰
CDL
CDLOPā€¢5w 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ā€¢5w 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ā€¢5w ago
No description
CDL
CDLOPā€¢5w ago
You have no idea how fucking relieved I am, I was about a minute away from relocating to zimbabwe and living on ants
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
that is interesting
b1mind
b1mindā€¢5w ago
Don't use syncing in your dev env it never goes well Glad you got it sorted
CDL
CDLOPā€¢5w ago
what dya mean? (its 2am) wait a fucking minute I'm pushing changes on git but it's not updating my github šŸ˜„
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
check if the origin url is set
CDL
CDLOPā€¢5w ago
I think I accidentally created a branch?
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
it's possible
CDL
CDLOPā€¢5w ago
No description
No description
CDL
CDLOPā€¢5w ago
man I'm confused
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
you can create a local branch
CDL
CDLOPā€¢5w ago
this'll be it
No description
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
that is a mess also, why are you using the console to do git work instead of vscode's ui?
CDL
CDLOPā€¢5w ago
Likely caused when it "broke" earlier and I was mashing commands to get it fixed huh, the ui?
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
yes, the ui
CDL
CDLOPā€¢5w ago
I have a feeling it's still borked, hmm
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
it's possible
CDL
CDLOPā€¢5w ago
No description
CDL
CDLOPā€¢5w ago
1 of these has a fatal error on it still
CDL
CDLOPā€¢5w ago
No description
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
you should sleep
b1mind
b1mindā€¢5w 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ā€¢5w 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ā€¢5w ago
growing pains its teh way
CDL
CDLOPā€¢5w ago
anyway it works, happy days, now I can sleep thanks for the assistance gents!
b1mind
b1mindā€¢5w ago
You did all the work ! gj gn
į¼”ĻĻ‰Ļ‚
į¼”ĻĻ‰Ļ‚ā€¢5w ago
if i were you, i would make a branch and work on that branch
Want results from more Discord servers?
Add your server