{"action":"created","issue":{"url":"https://api.github.com/repos/Hacklone/private-bower/issues/171","labels_url":"https://api.github.com/repos/Hacklone/private-bower/issues/171/labels{/name}","comments_url":"https://api.github.com/repos/Hacklone/private-bower/issues/171/comments","events_url":"https://api.github.com/repos/Hacklone/private-bower/issues/171/events","html_url":"https://github.com/Hacklone/private-bower/issues/171","id":104189721,"number":171,"title":"Failing to refresh cached repo with merge errors","user":{"login":"forketyfork","id":1592872,"avatar_url":"https://avatars.githubusercontent.com/u/1592872?v=3","gravatar_id":"","url":"https://api.github.com/users/forketyfork","html_url":"https://github.com/forketyfork","followers_url":"https://api.github.com/users/forketyfork/followers","following_url":"https://api.github.com/users/forketyfork/following{/other_user}","gists_url":"https://api.github.com/users/forketyfork/gists{/gist_id}","starred_url":"https://api.github.com/users/forketyfork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forketyfork/subscriptions","organizations_url":"https://api.github.com/users/forketyfork/orgs","repos_url":"https://api.github.com/users/forketyfork/repos","events_url":"https://api.github.com/users/forketyfork/events{/privacy}","received_events_url":"https://api.github.com/users/forketyfork/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-01T05:26:23Z","updated_at":"2015-09-01T05:57:03Z","closed_at":null,"body":"private-bower sometimes fails to refresh certain cached repositories. It looks like this in the logs:\r\n```\r\n[bower]  1/9/15 09:46:11   Error during \"git pull\" in \"/var/private-bower/gitRepoCache/lodash\". Output was: Auto-merging lodash.core.min.js\r\nCONFLICT (content): Merge conflict in lodash.core.min.js\r\nAuto-merging lodash.core.js\r\nAutomatic merge failed; fix conflicts and then commit the result.\r\n\r\n[bower]  1/9/15 09:46:11   Command failed: /bin/sh -c git pull\r\n\r\nundefined\r\n```\r\nI suppose that this happens when a repository history was overwritten by its authors at some point in time, so private-bower can't automatically merge or reset the cached repo. Manually resetting the last local commit solves the problem:\r\n\r\n```\r\ngit reset --hard HEAD~1\r\ngit pull\r\n```\r\n\r\nI saw this happen on several cached repos of popular libraries (lodash, jointjs, bootstrap-fileinput) for the last week, so such history rewrites might appear quite often. Possibly, to avoid this, instead of `pull`ing, private-bower should do a hard reset of the master branch, like this:\r\n```\r\ngit fetch --all\r\ngit reset --hard origin/master\r\n```"},"comment":{"url":"https://api.github.com/repos/Hacklone/private-bower/issues/comments/136593816","html_url":"https://github.com/Hacklone/private-bower/issues/171#issuecomment-136593816","issue_url":"https://api.github.com/repos/Hacklone/private-bower/issues/171","id":136593816,"user":{"login":"forketyfork","id":1592872,"avatar_url":"https://avatars.githubusercontent.com/u/1592872?v=3","gravatar_id":"","url":"https://api.github.com/users/forketyfork","html_url":"https://github.com/forketyfork","followers_url":"https://api.github.com/users/forketyfork/followers","following_url":"https://api.github.com/users/forketyfork/following{/other_user}","gists_url":"https://api.github.com/users/forketyfork/gists{/gist_id}","starred_url":"https://api.github.com/users/forketyfork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/forketyfork/subscriptions","organizations_url":"https://api.github.com/users/forketyfork/orgs","repos_url":"https://api.github.com/users/forketyfork/repos","events_url":"https://api.github.com/users/forketyfork/events{/privacy}","received_events_url":"https://api.github.com/users/forketyfork/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T05:57:03Z","updated_at":"2015-09-01T05:57:03Z","body":"Oops, I've missed the pr that was supposed to fix this: #93\r\nBut I still see this issue on my system. I have the latest versions of node, private-bower and git:\r\n\r\n```\r\n# node --version\r\nv0.12.7\r\n# private-bower --version\r\n1.1.4\r\n# git --version\r\ngit version 2.5.1\r\n```"}}