Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Keep git repository updated

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 ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Basically, you have some local changes that are not yet committed. Given the fact that you are pulling, there are two possibilities:

  1. You have done some local changes which were not committed
  2. 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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading