1

We're having issues writing to a repository using our Github API Token, probably because what we're trying to achieve isn't possible. If it isn't feasible then I would like an explanation of why we can't perform the following:

We would want to avoid the Web Application Flow because what we want deems simple. Ideally we would like to use our API token like this:

Following this guide: https://github.com/blog/1270-easier-builds-and-deployments-using-git-over-https-and-oauth 
If we scroll to the very bottom of "Using OAuth with Git", we will see:

To avoid writing tokens to disk, don't clone. Instead, just use the full git URL in your push/pull operations

As the doc states, we would like to perform push/pull operations. An example pull operation would be:

mkdir foo
cd foo
git init
git pull https://<token>@github.com/username/bar.git

Now we would want to perform a push operation (ie: something like below, as the documentation implies)

git add file
git commit file -m "Changed file"
git push https://<token>@github.com/username/bar.git master

The problem we're running into is on the push phase; we are stuck in performing the push operation. The error we receive is:

fatal: Authentication failed

What are we missing? All we want is for the service account to perform push/pull operations via the documentation I provided above. The service account has been added (with read/write access) to our organization.

Points worth mentioning:

  • Our API token has "scope: repo" access.
  • This example is from a Github Enterprise account.
4

1 回答 1

1

这似乎与我们当前版本的 Github Enterprise 未启用 SSL 有关。我的特定问题的解决方案是在最新版本上运行。这是我无法控制的事情,但是如果有人遇到类似的问题,您应该联系您雇主的支持台。

于 2013-11-12T13:24:33.233 回答