git切换分支报错error: Your local changes to the following files would be overwritten by checkout:

简介:

git切换分支报错,dev表示那个分支

$ git checkout dev

error: Your local changes to the following files would be overwritten by checkout:

dev是我们项目的分支,报错了。

我是因为修改了文件,所以没有提交然后必须切出来,进错了,但是这个切出来后之前修改就没了,

慎重考虑备份,提交,再切出。

那么我们先git checkout 出来

$ git checkout .
然后再单独

$ git checkout develop

目录
相关文章
|
开发工具 git
git checkout (branchname
git checkout (branchname) 是 Git 中切换分支的一种命令。通过这个命令,你可以将当前工作目录切换到指定的分支上。branchname 参数是可选的,如果不指定,则默认切换到主分支(master 或 main)。
326 2
|
编译器 开发工具 git
【Git异常】You are in ‘detached HEAD‘ state, which means that you‘re not on any branch Checkout a branch
【Git异常】You are in ‘detached HEAD‘ state, which means that you‘re not on any branch Checkout a branch
739 0
|
开发工具 git
成功解决git rebase问题:First, rewinding head to replay your work on top of it...
成功解决git rebase问题:First, rewinding head to replay your work on top of it...
|
开发工具 git 开发者
|
Shell 开发工具 git
【Git】解决Untracked Files Prevent Checkout的问题
【Git】解决Untracked Files Prevent Checkout的问题
3916 0
|
开发工具 git
If you are using the git profile, you need to set a Git URI in your configuration. If you are using
If you are using the git profile, you need to set a Git URI in your configuration. If you are using
444 0
|
开发工具 git
git报错,error: You have not concluded your merge (MERGE_HEAD exists). hint: Please,
git报错,error: You have not concluded your merge (MERGE_HEAD exists). hint: Please,
429 0
|
Shell 开发工具 git
(极简解决)git commit 时出现:please enter the commit message for your changes
(极简解决)git commit 时出现:please enter the commit message for your changes
1834 0
|
数据可视化 开发工具 Android开发
Android Git 拉取代码报错:error: cannot pull with rebase: Your index contains uncommitted changes.
造成原因:在使用Android Studio中Git的Commit Directory 将本地更改的代码保存到本地后,点击commit,发现提交不上去,发现本地有代码,这时候拉取代码,报错:cannot pull with rebase: Your index contains uncommitted changes.表示我的索引有未提交的改变
|
开发工具 git
git checkout到新的分支之后原来未提交的代码找回
git checkout到新的分支之后原来未提交的代码找回
836 0