1

I have a problem with Github. Yesterday it was working normally, but today it looks like this: enter image description here enter image description here

i clicked the button to stash it but doesn't take me anywhere. I opened vscode, so, look the error file enter image description here

so I pasted and copied the code saved on Github web, ok, I saved it, I tried to make a commit end it's error. enter image description here

i don't know what i should do for my github to work normally

tymtam
  • 31,798
  • 8
  • 86
  • 126
Beatriz
  • 11
  • 1
  • What does `git status` say? – tymtam Jan 19 '23 at 02:36
  • 1
    Please post console output as text, not as images. – tymtam Jan 19 '23 at 02:37
  • Does this answer your question? [Git cannot lock ref 'HEAD': unable to resolve reference HEAD](https://stackoverflow.com/questions/39057962/git-cannot-lock-ref-head-unable-to-resolve-reference-head) – tymtam Jan 19 '23 at 02:44
  • 2
    This is a secondary problem, but you need a `.gitignore` so that git ignores the node_modules folder. You could use this one: https://github.com/github/gitignore/blob/main/Node.gitignore – tymtam Jan 19 '23 at 02:46
  • @tymtam thanks for help me, and sorry about the images! I managed to solve the problem, but I had to do a git reset --hard "in the project folder" and clone the repository again – Beatriz Jan 19 '23 at 17:22

1 Answers1

0

Run git fsck and post the output.

If that shows errors (and I'm pretty sure it will), try running:

git reflog expire \
    --stale-fix \
    --expire-unreachable=now \
    --all \
    --rewrite &&
for REMOTE in $(git remote); do
    git remote set-head "$REMOTE" --delete
done

Failing that, try a re-clone.

amphetamachine
  • 27,620
  • 12
  • 60
  • 72