Skip to main content
1 of 4
kenorb
  • 162.9k
  • 94
  • 697
  • 763

If you want to push your current detached HEAD (check git log before), try:

git push origin HEAD:master

to send your detached HEAD into master branch at origin. If your push gets rejected, try git pull origin master first to get the changes from origin. If you don't care about the changes from origin and it's rejected, because you did some intentional rebase and you want to replace origin/master with your currently detached branch - then you may force it (-f).

kenorb
  • 162.9k
  • 94
  • 697
  • 763