Note: The personal experience record of Git beginners is for reference only
1. Pull is not possible because you have unmerged files.
Symptoms: Pull
$ git pull
Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use ‘git add/rm < file> ‘
as appropriate to mark resolution, or use ‘git commit -a’
I think it’s because the local file is colliding
Solutions:
Reference –
”
1. Pull will use Git merge to cause conflicts. The conflicting files need to be resolved out of Git Add-u and git commit can only be pulled successfully.
2. If you want to abort local file changes, use Git reset –hard FETCH_HEAD. FETCH_HEAD represents the commit point formed after the last successful Git pull. Then git pull.
note:
Git merge forms a merge-head. Git push forms references like HEAD. A HEAD represents a local reference that has been formed after a recent successful push.
”
In my experience, sometimes this happens for no reason, and the Untracked files are quite many (actually I only changed one or two files), so I had to save the local changes I decided to make first, then use Git reset –hard FETCH_HEAD to go back to the point after the last successful pull, and then pull again without any problems
2.You are not currently on a branch.
Symptoms: During a pull, the “git reset –hard FETCH_HEAD” method fails.
1. Pull is not possible because you have unmerged files.
Symptoms: Pull
$ git pull
Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use ‘git add/rm < file> ‘
as appropriate to mark resolution, or use ‘git commit -a’
I think it’s because the local file is colliding
Solutions:
Reference –
”
1. Pull will use Git merge to cause conflicts. The conflicting files need to be resolved out of Git Add-u and git commit can only be pulled successfully.
2. If you want to abort local file changes, use Git reset –hard FETCH_HEAD. FETCH_HEAD represents the commit point formed after the last successful Git pull. Then git pull.
note:
Git merge forms a merge-head. Git push forms references like HEAD. A HEAD represents a local reference that has been formed after a recent successful push.
”
In my experience, sometimes this happens for no reason, and the Untracked files are quite many (actually I only changed one or two files), so I had to save the local changes I decided to make first, then use Git reset –hard FETCH_HEAD to go back to the point after the last successful pull, and then pull again without any problems
2.You are not currently on a branch.
Symptoms: During a pull, the “git reset –hard FETCH_HEAD” method fails.
$ git pull You are not currently on a branch, so I cannot use any 'branch.<branchname>.merge' in your configuration file. Please specify which remote branch you want to use on the command line and try again (e.g. 'git pull <repository> <refspec>'). See git-pull(1) for details.
Solutions:
First git checkout-B temp
Second, Git Checkout Master
You can restore the master Repository state and then pull
Original: https://blog.51cto.com/halolk/1304701
Read More:
- Git pull error: pull is not possible because you have unmerged files
- Pull is not possible because you have unmerged files
- Merging is not possible because you have unmerged files
- Git solves pull origin error: the following untracked working tree files would be rewritten by merge
- Committing is not possible because you have unmerged files
- Git pull undo misoperation
- [Git] git pull pull remote git push to remote git commit submit reject
- Error: You have not concluded your merge (MERGE_HEAD exists)
- pathspec ‘master’ did not match any files known to git
- How to Fix GIT Push Error
- You are not allowed to upload merges in Git push
- You have not concluded your merge (MERGE_HEAD exists)
- Git push you are not allowed to upload merges
- How to Fix LDPlayer4 Proxy Setting Not Work Issue
- error: The following untracked working tree files would be overwritten by merge
- How to Fix error performing isolated work; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarE
- Please specify which branch you want to merge with
- The problem that headers [‘content-type ‘] does not work is set in the Axios get method request interface
- You need to resolve your current index first
- check a tree is balanced or not