I'm still confused with all Git options :-(
I have a local repository and I want to update it on a daily basis with latest on a branch.
There are no changes in it so I just ran this every day
git pull origin develop
but for some reason I get this error so I guess pull is a bad option, I also don't want to delete and clone it every day
error: Pulling is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
Which command I should use ?
CodePudding user response:
Basically, you have some local changes that are not yet committed. Given the fact that you are pulling, there are two possibilities:
- You have done some local changes which were not committed
- On the remote copy of the repo some commits were being done which cannot be automatically merged with the changes you have
To solve this issue, first run
git status
See whether it's a merge issue. If not, then you can decide to stash your local changes, commit them or git reset --hard
to roll back.
If, on the other hand, it's a merge conflict, then you will need to compare the versions and fix each merge conflict separately. Read more here: https://www.simplilearn.com/tutorials/git-tutorial/merge-conflicts-in-git
CodePudding user response:
Git informs you that you have local changed files. Try
git pull --autostash