Git 仅在 Eclipse 中工作

问题描述 投票:0回答:1

我不明白为什么 Git 在 eclipse 中工作,但在 git bash 中不起作用。该存储库是一个 gitlab 存储库,我通过用户名和访问令牌进行访问。如果我尝试拉动,在日食中我会得到我期望的响应:

在 git bash 控制台中,当我输入“git pull”时,我得到

fatal: unable to access 'https://gitlab.xxxx.it/xxxxxx/xxxxx/xxxxxx.git/': The requested URL returned error: 403

这是我的 git 配置列表:

$ git config --list
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=C:/Program Files/Git/mingw64/etc/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=true
core.editor="C:\\Program Files\\Notepad++\\notepad++.exe" -multiInst -notabbar -nosession -noPlugin
pull.rebase=false
credential.helper=manager
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master
user.name=giovanni.difronzo
[email protected]
http.sslbackend=schannel
http.sslverify=false
pack.deltacachesize=2047m
pack.packsizelimit=2047m
pack.windowmemory=2047m
pack.window=1
core.packedgitlimit=512m
core.packedgitwindowsize=512m
core.compression=0
difftool.sourcetree.cmd=''
mergetool.sourcetree.cmd=''
mergetool.sourcetree.trustexitcode=true
credential.helper=manager
core.symlinks=false
core.repositoryformatversion=0
core.filemode=false
core.logallrefupdates=true
remote.origin.url=https://gitlab.xxxxx.it/xxxx/xxxx/xxxxx.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.master.rebase=false
branch.develop.remote=origin
branch.develop.merge=refs/heads/develop
branch.develop.rebase=false

有人可以帮助我吗?也许 git bash 中的 git 没有读取访问令牌? 先谢谢你了

git eclipse gitlab git-bash
1个回答
0
投票

问题解决了!我必须在 git 配置中设置 VPN 代理:

git config --global http.proxy http://xxx.xx.xx:xxx

然后我输入了 gitlab 的用户名和个人访问令牌,它就可以工作了!在 Eclipse 中,即使没有设置代理,我也可以输入用户名和个人访问令牌。我不知道为什么。

© www.soinside.com 2019 - 2024. All rights reserved.