Created
February 4, 2018 21:15
-
-
Save Tknott95/f11f9ae2c93d2a19d59e986b802bb95c to your computer and use it in GitHub Desktop.
Git error: Failed to resolve HEAD as a valid ref.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#TO FIX Git error: Failed to resolve HEAD as a valid ref. | |
##### cd into repo | |
$ cd ~/Workspace/MyProject/ | |
##### remove .git recursively (Just do it this way so it restores proper) | |
$ rm -rf .git | |
###### Initialize a new repo | |
$ git init | |
###### Add remote URL for git via: ssh | |
$ git remote add origin git@github.com:<YOURGITUSERNAME>/<REPO>.git | |
EXAMPLE: git remote add origin git@github.com:Tknott95/this_is_a_project.git | |
###### ADD CHANGES | |
$ git add . | |
###### COMMIT CHANGES | |
$ git commit -m 'Fixed BROKEN HEAD' | |
###### PUSH UP TO MASTER FINALIZE SYMLINK | |
$ git push -u origin master | |
Thanks
Thanks
Thx
Thanks a lot.
Спасибо, брат!
Damn you, bro it deleted all files
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-uf pushes to upstream forcibly.