Warning: you are leaving 1 commit behind, not connected to any of your branches:

当Git提交后没有关联任何分支,会收到警告提示‘youareleaving1commitbehind,notconnectedtoanyofyourbranches’。可以通过查看gitreflog找出丢失的提交,然后使用gitreset--hard命令将指定的提交移动到目标分支。

在使用git提交时,遇到的奇怪问题

Warning: you are leaving 1 commit behind, not connected to any of your branches:

在我使用idea进行一次提交时,可能是误操作,导致提交后,在提交记录中中,看不到本次提交的记录,但是在控制台,显示Warning: you are leaving 1 commit behind, not connected to any of your branches:翻译过来,大概意思是,这次提交,没有选择提交分支,所以提交到了本地,这个时候,切换分支,当然就找不到这条记录

解决办法:

使用git,输入命令,git reflog(查看本地提交日志)

找到你对应提交的日志的revision版本

然后切换到你需要提交到的分支

git reset --hard 版本号

sunhaoming@ubuntu:~/ipc_platform/platform$ git checkout my_branch Warning: you are leaving 5 commits behind, not connected to any of your branches: 4f775a4 修改出厂默认为auto模式 b9d157d 修改了代码中调试显示等级和部分注释 92c0e34 修改了nifc/system.c 在判断internet_wired_enable支持自动模式的一处漏修改 修改了nasw_reload触发逻辑,避免重复触发带来诊断重复 修改了nifc/nifc.c,system.c:新增网关优先级函数,设置有线网关优先(优先级100)、4G网关优先级(优先级500);修改逻辑为网线插入时,暂不删除有线网关,可以解决 “通过4G网络发包 误判断本故障有线网络为通路 切换至有线网络后 又因网络故障切换回4G 陷入循环”的bug 经过调试与测试,确定修改后的代码可以完成课题逻辑,不对原有模块逻辑产生影响 取消了做课题时自己添加的nifc/lte模块注释 取消了显著标识的注释,现nasw模块注释大多为ERROR,方便展示新模块结果,后续会恢复正常 Change-Id: Ia446683d1259447e00ffba8347670045bc03bf12 5afe262 代码已实现预期功能,剩余部分明显标识注释和调试显示等级待修改 775dceb 基础功能完成 测试通过 物理防抖debounce部分有bug If you want to keep them by creating a new branch, this may be a good time to do so with: git branch <new-branch-name> 4f775a4 Switched to branch 'my_branch' sunhaoming@ubuntu:~/ipc_platform/platform$ git checkout 4f775a45b3dd706b0e7711460a0b3125314a42f7 Note: checking out '4f775a45b3dd706b0e7711460a0b3125314a42f7'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b <new-branch-name> HEAD is now at 4f775a4... 修改出厂默认为auto模式 sunhaoming@ubuntu:~/ipc_platform/platform$ sunhaoming@ubuntu:~/ipc_platform/platform$ sunhaoming@ubuntu:~/ipc_platform/platform$ sunhaoming@ubuntu:~/ipc_platform/platform$ git branch * (HEAD detached at 4f775a4) develop_1.7_RED my_branch
最新发布
11-15
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值