Fix a Git detached head?

前端 未结 23 1373
臣服心动
臣服心动 2020-11-22 05:42

I was doing some work in my repository and noticed a file had local changes. I didn\'t want them anymore so I deleted the file, thinking I can just checkout a fresh copy. I

23条回答
  •  孤街浪徒
    2020-11-22 06:46

    I wanted to keep my changes so, I just fix this doing...

    git add .
    git commit -m "Title" -m "Description"
    (so i have a commit now example: 123abc)
    git checkout YOURCURRENTBRANCH
    git merge 123abc
    git push TOYOURCURRENTBRANCH
    

    that work for me

提交回复
热议问题