I try to upload my code to GitHub using LFS and face a problem below
problem description
below is the code I have ran
git init
git install lfs
git lfs migrate import --include="*.tres"
However, I get a error like below
migrate: override changes in your working copy? All uncommitted changes will be lost! [y/N] y
migrate: changes in your working copy will be overridden ...
Git can't resolve ref: "HEAD"
My attempts to solve the problem:
- I have checked this answer(git status shows fatal: bad object HEAD) saying that some git data is lost. I believe it is not the case for me because I am not yet linking it to a remote repo.
- I also tried the command
git fsck --full
and get the output below
Checking object directories: 100% (256/256), done.
notice: HEAD points to an unborn branch (main)
notice: No default reference
I find it strange because the branch is main instead of the master so I think if it is the case - I do not change the name of the branch
- I try to copy and paste all files into a new folder (without git files) and run these commands again but the problem is still there when files can run smoothly.