Git resolves an error: The following untracked working tree files would be overwritten by checkout
December 27, 2017 12:09:50
Reading count: 1,792
When switching branches in IDEA, such an error occurred, resulting in The failure to switch properly: error: The following untracked working tree files would be overwritten by checkout
According to the error message, the problem is caused by some untracked working tree files. So just solving these untracked files solves this problem.
Solutions:
Open SourceTree through the command line, enter the local version warehouse directory, directly executed
December 27, 2017 12:09:50
Reading count: 1,792
When switching branches in IDEA, such an error occurred, resulting in The failure to switch properly: error: The following untracked working tree files would be overwritten by checkout
According to the error message, the problem is caused by some untracked working tree files. So just solving these untracked files solves this problem.
Solutions:
Open SourceTree through the command line, enter the local version warehouse directory, directly executed
git clean -d -fx
Can. Git clean-d-fx means: delete files that don’t have Git add; git clean-fx means: delete files that don’t have Git add.
Git clean parameters
-n displays files and directories to be deleted;
-x – Deleting ignored files is no longer recognized by Git
-D — Deletes files that have not been added to Git’s path
— F — Forced operation
Git clean – n
Git clean – df
Git clean – f
Read More:
- Git Pull Error:The following untracked working tree files would be overwritten by merge
- [Solved] git Error: error: Your local changes to the following files would be overwritten by merge
- Git Pull error: Your local changes to the following files would be overwritten by merge:
- Git under Windows reports an error: warning: LF will be replaced by CRLF in ××××.××
- [Solved] Toad Set Error: The following files specified on the Executables tab could not be found:TNS Ping
- Mac installation tree command error solution
- NPM Install Error: npm ERR! ERESOLVE unable to resolve dependency tree
- [Solved] swiper Error: The requested module ‘react’ is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export
- Solve the problem that the native machine cannot use ant script checkout project
- [Solved] CMake error: error in configuration process, project files may be invalid
- This limit can be set by changing the [search.max_open_scroll_context] setting
- The tree component in easyUI does not display data or displays undefined solutions
- [Solved] error: unpack failed: error Missing tree
- [Solved] fatal: not in a git directory Error: Command failed with exit 128: git
- [Solved] Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
- How to Fix Error Cannot find command ‘git‘ – do you have ‘git‘ installed and in your PATH?
- Android Working Directory:NULL Environment:NULL Error
- [Solved] Xcode13.1 Upgrade Error: CocoaPods installed but not working Failed to build gem native extension
- git error:invalid path [How to Solve]
- Git pull and Git pull origin master Warning: Pulling without specifying how to reconcile divergent branches