XCode Git头已分离 [英] XCode Git Head Detached

查看:58
本文介绍了XCode Git头已分离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是编程新手,所以请不要咬我的头!我在GitHub上使用Xcode,但是突然停止工作了. Xcode不在源代码管理上显示当前分支,它不加载远程存储库,并且git状态为"head detached".

I'm new to programming so please dont bite my head off! I'm using Xcode with GitHub, but it's suddenly stopped working. Xcode is not showing the current branch on source control, it doesnt load remote repositories, and the git status is 'head detached'.

我已经进入命令行并完成了'sudo git --version',并接受了新许可证.

I've gone to the command line and done 'sudo git --version', and accepted the new license.

这个项目很有趣,但是我已经做了很多工作.我不介意只是在需要时丢失项目的历史记录,我只是想让GitHub的源代码控制恢复到工作状态.有什么建议吗?

This project is for fun, but I've put a lot of work into it. I don't mind just losing the history of the project if need be, I'd just like to get GitHub's source control back to a working state. Any suggestions?

推荐答案

如果要将带有分离头的提交添加到任何分支,则应使用cherry-pick命令

If you want to add commit with detached head to any branch you should use cherry-pick command

git checkout "branchname"
git cherry-pick "commitnumber"

这篇关于XCode Git头已分离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆