简体   繁体   中英

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. 在此输入图像描述

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM