报告访问 bitbucket 的问题
Reporting problems to access bitbucket
当我执行这条命令时:
$ git remote -v
结果:
origin https://ShafizadehSajad@bitbucket.org/ShafizadehSajad/test.git (fetch)
origin https://ShafizadehSajad@bitbucket.org/ShafizadehSajad/test.git (push)
当我执行这条命令时:
$ git push -u origin --all
/* or even this one:
* $ git push -4 origin master
*/
结果:
// it waits for a while an throws this:
fatal: unable to access 'https://ShafizadehSajad@bitbucket.org/ShafizadehSajad/test.git/': Failed to connect to bitbucket.org port 443: Timed out
当我执行这条命令时:
$ ping -n 10 bitbucket.org
结果:
Pinging bitbucket.org [104.192.143.2] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 104.192.143.2:
Packets: Sent = 10, Received = 0, Lost = 10 (100% loss),
如您所见,我无法连接到 bitbucket 并应用更改。有什么问题?我该如何解决?
备注:
- 我用windows8OS
- bitbucket 上的当前回购是 github 上的一个回购,我在 bitbucket 中使用它。当我在 github 时,它也能正常工作。
编辑:
我现在已经执行了这条命令:
$ git config --local http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
现在,当我执行此操作时:
$ git push -u origin --all
结果是:
fatal: unable to access 'https://ShafizadehSajad@bitbucket.org/ShafizadehSajad/test.git/': Couldn't resolve proxy 'proxy.server.com'
嘿..情况变得更糟了。至少告诉我怎样才能回到以前的状态?
一般解决方案
没有事件报告on BitBucket side or on twitter or on isitdownrightnow,所以这是你这边的问题。
切换到 ssh url 不会有太大帮助,因为 bitbucket.org 无论如何都无法访问。
检查您的 firewall prevents somehow bitbucket.org access.
更多见我之前的回答“”
- 检查您之前成功推送到 github.com 是否需要代理。
- 检查您的 DNS 设置是否已更改(解释您的代理未解析的原因)
具体解决方案
经过讨论,OP stack can browse bitbucket.org
only through a proxy (psiphon, see also this article or this one).
此代理不需要身份验证,但应配置为 运行 始终在同一端口上以便 Git 使用它。例如,端口61234
(前提是port is not already used)
确保此代理仅用于 bitbucket.org
很简单,因为 Git 1.8.5 (2013).
从您想要的任何文件夹中键入:
git config --global http."https://<username>@bitbucket.org".proxy http://localhost:61234
在your case中:
git config --global http."https://ShafizadehSajad@bitbucket.org".proxy http://localhost:61234
这将修改您的 global Git 设置(记录在 C:\Users\<You>\.gitconfig
中),并将这些设置应用于您将创建或已经创建的任何本地存储库有。
要测试对远程 Git 存储库的访问而无需克隆它,请使用 git ls-remote
:
cd /path/to/local/repo
git remote -v
origin https://ShafizadehSajad@bitbucket.org
git ls-remote origin
因为 March 2015 and Git 2.7.3, Git for Windows comes with a Git Credential Manager for Windows 允许 Git 使用本机 Windows 凭据存储缓存密码 :如果您键入 git config credential.helper
,您应该看到“manager
”。
在第一次连接到 bitbucket.org
时(就像在 git ls-remote
期间一样,完成测试访问),系统将提示您输入 bitbucket 凭据(即 ShafizadehSajad
+ bitbucket 密码)。下一个连接将重用这些凭据。
使用 Control Panel
, go to User Accounts
and Family Safety -> Credential Manager
打开您的凭据存储:您将看到一个 bitbucket.org
条目。
一旦 git ls-remote
正常工作(不要询问您的密码,因为它已缓存在 Windows 凭据存储中),git push
可能会失败,因为远程仓库从未被提取到本地仓库中。
为此,首先确保 git pull
将始终变基。从任何文件夹中输入(并且只有一次,因为它是一个全局配置)
git config --global pull.rebase true
git config --global rebase.autoStash true
(那些)
然后,获取您的远程 bitbucket 存储库:
cd /path/to/local/repo
git fetch
git branch -u origin/master master
您需要确保本地 master
分支正在跟踪刚刚获取的远程跟踪 origin/master
分支。
在“Why do I need to explicitly push a new branch?”查看更多信息。
最后,先拉,因为有些提交是直接在 BitBucket 上完成的,而其他提交是在 PC 本地完成的:
Before rebase:
x--x--x (master)
o--o (origin/master)
git status:
(2 behind, 3 ahead)
After pull (which does here a fetch+rebase)
o--o--x'--x'--x' (master)
|
(origin/master)
rebase 已在获取的远程提交“o
”之上重放本地“x
”提交。
现在您可以推送了:
git push
所有内容都应该在 bitbucket.org 上可见。
o--o--x'--x'--x' (master, origin/master)
(并且 github.com
不应该受到影响,这意味着 git ls-remote https://github.com/sajadshafizadeh/test.git
应该仍然有效)
当我执行这条命令时:
$ git remote -v
结果:
origin https://ShafizadehSajad@bitbucket.org/ShafizadehSajad/test.git (fetch)
origin https://ShafizadehSajad@bitbucket.org/ShafizadehSajad/test.git (push)
当我执行这条命令时:
$ git push -u origin --all
/* or even this one:
* $ git push -4 origin master
*/
结果:
// it waits for a while an throws this:
fatal: unable to access 'https://ShafizadehSajad@bitbucket.org/ShafizadehSajad/test.git/': Failed to connect to bitbucket.org port 443: Timed out
当我执行这条命令时:
$ ping -n 10 bitbucket.org
结果:
Pinging bitbucket.org [104.192.143.2] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 104.192.143.2:
Packets: Sent = 10, Received = 0, Lost = 10 (100% loss),
如您所见,我无法连接到 bitbucket 并应用更改。有什么问题?我该如何解决?
备注:
- 我用windows8OS
- bitbucket 上的当前回购是 github 上的一个回购,我在 bitbucket 中使用它。当我在 github 时,它也能正常工作。
编辑:
我现在已经执行了这条命令:
$ git config --local http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
现在,当我执行此操作时:
$ git push -u origin --all
结果是:
fatal: unable to access 'https://ShafizadehSajad@bitbucket.org/ShafizadehSajad/test.git/': Couldn't resolve proxy 'proxy.server.com'
嘿..情况变得更糟了。至少告诉我怎样才能回到以前的状态?
一般解决方案
没有事件报告on BitBucket side or on twitter or on isitdownrightnow,所以这是你这边的问题。
切换到 ssh url 不会有太大帮助,因为 bitbucket.org 无论如何都无法访问。
检查您的 firewall prevents somehow bitbucket.org access.
更多见我之前的回答“
- 检查您之前成功推送到 github.com 是否需要代理。
- 检查您的 DNS 设置是否已更改(解释您的代理未解析的原因)
具体解决方案
经过讨论,OP stack can browse bitbucket.org
only through a proxy (psiphon, see also this article or this one).
此代理不需要身份验证,但应配置为 运行 始终在同一端口上以便 Git 使用它。例如,端口61234
(前提是port is not already used)
确保此代理仅用于 bitbucket.org
很简单,因为 Git 1.8.5 (2013).
从您想要的任何文件夹中键入:
git config --global http."https://<username>@bitbucket.org".proxy http://localhost:61234
在your case中:
git config --global http."https://ShafizadehSajad@bitbucket.org".proxy http://localhost:61234
这将修改您的 global Git 设置(记录在 C:\Users\<You>\.gitconfig
中),并将这些设置应用于您将创建或已经创建的任何本地存储库有。
要测试对远程 Git 存储库的访问而无需克隆它,请使用 git ls-remote
:
cd /path/to/local/repo
git remote -v
origin https://ShafizadehSajad@bitbucket.org
git ls-remote origin
因为 March 2015 and Git 2.7.3, Git for Windows comes with a Git Credential Manager for Windows 允许 Git 使用本机 Windows 凭据存储缓存密码 :如果您键入 git config credential.helper
,您应该看到“manager
”。
在第一次连接到 bitbucket.org
时(就像在 git ls-remote
期间一样,完成测试访问),系统将提示您输入 bitbucket 凭据(即 ShafizadehSajad
+ bitbucket 密码)。下一个连接将重用这些凭据。
使用 Control Panel
, go to User Accounts
and Family Safety -> Credential Manager
打开您的凭据存储:您将看到一个 bitbucket.org
条目。
一旦 git ls-remote
正常工作(不要询问您的密码,因为它已缓存在 Windows 凭据存储中),git push
可能会失败,因为远程仓库从未被提取到本地仓库中。
为此,首先确保 git pull
将始终变基。从任何文件夹中输入(并且只有一次,因为它是一个全局配置)
git config --global pull.rebase true
git config --global rebase.autoStash true
(那些
然后,获取您的远程 bitbucket 存储库:
cd /path/to/local/repo
git fetch
git branch -u origin/master master
您需要确保本地 master
分支正在跟踪刚刚获取的远程跟踪 origin/master
分支。
在“Why do I need to explicitly push a new branch?”查看更多信息。
最后,先拉,因为有些提交是直接在 BitBucket 上完成的,而其他提交是在 PC 本地完成的:
Before rebase:
x--x--x (master)
o--o (origin/master)
git status:
(2 behind, 3 ahead)
After pull (which does here a fetch+rebase)
o--o--x'--x'--x' (master)
|
(origin/master)
rebase 已在获取的远程提交“o
”之上重放本地“x
”提交。
现在您可以推送了:
git push
所有内容都应该在 bitbucket.org 上可见。
o--o--x'--x'--x' (master, origin/master)
(并且 github.com
不应该受到影响,这意味着 git ls-remote https://github.com/sajadshafizadeh/test.git
应该仍然有效)