我能够通过HTTPS身份验证克隆此repo的副本.我做了一些提交,想要推回到GitHub服务器.在Windows 7 x64上使用Cygwin.
C:\cygwin\home\XPherior\Code\lunch_call>git push
Password:
error: The requested URL returned error: 403 while accessing https://MichaelDrog
alis@github.com/derekerdmann/lunch_call.git/info/refs
fatal: HTTP request failed
Run Code Online (Sandbox Code Playgroud)
同时使用详细模式进行设置.我还是很困惑.
C:\cygwin\home\XPherior\Code\lunch_call>set GIT_CURL_VERBOSE=1
C:\cygwin\home\XPherior\Code\lunch_call>git push
Password:
* Couldn't find host github.com in the _netrc file; using defaults
* About to connect() to github.com port 443 (#0)
* Trying 207.97.227.239... * 0x23cb740 is at send pipe head!
* Connected to github.com (207.97.227.239) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: C:\Program Files (x86)\Git/bin/curl-ca-bundle.crt
CApath: none
* SSL …Run Code Online (Sandbox Code Playgroud) 我还在浏览一些关于RoR的指南,我在这里部署演示应用程序
我按照说明:
完成Microposts资源后,现在是将存储库推送到GitHub的好时机:
Run Code Online (Sandbox Code Playgroud)$ git add . $ git commit -a -m "Done with the demo app" $ git push
这里发生的错误是推动部分......它输出了这个:
$ git push
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using
git remote add <name> <url>
git push <name>
Run Code Online (Sandbox Code Playgroud)
所以我尝试按照说明执行此命令:
$ git remote add demo_app 'www.github.com/levelone/demo_app'
fatal: remote demo_app already exists.
Run Code Online (Sandbox Code Playgroud)
所以我推:
$ git push demo_app
fatal: 'www.github.com/levelone/demo_app' does not appear to be a git repository
fatal: The …Run Code Online (Sandbox Code Playgroud) 我已经安装了GitHub for Windows和GitExtensions,并且在我的路径中有多个版本的git.exe.

C:\Users\Rajat\AppData\Local\GitHub\PortableGit_93e8418133eb85e81a81e5e19c272776524496c6\cmd\git.exe
C:\Users\Rajat\AppData\Local\GitHub\PortableGit_93e8418133eb85e81a81e5e19c272776524496c6\bin\git.exe
E:\cygwin\bin\git.exe
C:\Program Files (x86)\Git\cmd\git.exe
C:\Program Files (x86)\Git\bin\git.exe
Run Code Online (Sandbox Code Playgroud)
现在,当我git push origin master使用最后三个中git.exe的任何一个时,它会询问我的用户名.但Portable Git不会要求用户名.请参阅以下屏幕截图:

心形的角色只是^C如此无视.
在这种情况下如何处理身份验证?最后,我希望最后三个Gits不要求授权.怎么可能?
我在GitHub的Git中找到了两个额外的文件,但我怀疑它们是否重要:

我想在我的〜/ .gitconfig中将github.token的值设置为shell命令的结果.我目前有以下内容:
[github]
user = zmanji
token = !echo ~/.githubtoken 2> /dev/null
Run Code Online (Sandbox Code Playgroud)
但是git config github.token不返回〜/ .githubtoken文件的内容,而是返回命令本身.我怎样才能让它按照需要运行?
编辑:为了清楚,我正在努力实现这里隐含的内容:
您还可以将github.token定义为一个命令,该命令通过将变量设置为前缀为的命令字符串来返回stdout上的实际令牌
!.