1

I was committing and pushing in ordinary for my repository. but once i used command of git checkout for change to the previous version of my repository. after that i tried to commit and push, then it can not completed.

i try to use the --no-verify command to push the commit but it also not success.

error: failed to push some refs to 'https://github.com/ruwanliyanage123/Hair-4-U-Hospital.git'

i want to push my commit into github repository

ruwan liyanage
  • 419
  • 2
  • 11
  • 24

2 Answers2

1

Try to first check in which branch you are working do git branch, check is the one you are working. Then I sometimes do git pull to just make sure that the connection is working this should not delete your progress the you should be able to do git push. If you are afraid youll mess up first do a local back up of all project files except for the .git one which are hidden by default in windows.Lastly I would suggest never posting the actual link to your github repository in case whatever you are working is important, you can just replace with https://github.com/user/projectname.git

VericalId
  • 105
  • 12
1

Since you switched to a previous version of your repository, your head is most probably detached. You can't just go back anywhere in your history and make commits. Consider making a branch from there and then commit to it.

Abhishek Ranjan
  • 498
  • 3
  • 17