TorontoKid
TorontoKid

Reputation: 733

GITHub API Issue with file upload

I am trying to upload file to GitHub via GITHub API (http://developer.github.com/v3/repos/contents/). Somehow I am not able to upload file. When I tried to upload existing file it gave me message "{\"message\":\"refs/heads/master expected to be at ee1cd720841a4b5b06a8339c333c56b1748e66f9\",\"documentation_url\":\"http://developer.github.com/v3/repos/contents/\"}". When I went to github and tried to delete file using website it gave me below error. I can do workaround with reset head to previous version and move on. But I am trying to understand what caused this behavior and how can I prevent same in future. Neither Google nor Github Help was able to answer me so looking for something from community. Thanks for looking into it. enter image description here

Upvotes: 7

Views: 2950

Answers (1)

TorontoKid
TorontoKid

Reputation: 733

As Ivan suggested, if we try to create/update files using quick succession using API it causes mentioned behavior. Till issue is fixed we can workaround this by making thread sleep between two request. I hope it will help someone.

Upvotes: 4

Related Questions