简体   繁体   English

AWS Codecommit无法使用Git凭证使用HTTPS协议连接到第二仓库

[英]AWS codecommit can't connect to 2nd repo with HTTPS protocol using Git Credentials

I was going to connect to a second repository on AWS Codecommit(I already connect another one), but I got an error, though I am able to connect to this second repository,DL, though MINGW32. 我打算连接到AWS Codecommit上的第二个存储库(我已经连接了另一个存储库),但是我遇到了一个错误,尽管我可以通过MINGW32连接到第二个存储库DL。

No be noted, Repositoy was already existing locally so, I connected to the one remote one via SSH first time, and pushed all the code, then also executed git commands(mostly push) using HTTPS with git credentials . 不用说,Repositoy已经在本地存在,因此,我第一次通过SSH连接到一个远程站点 ,并推送了所有代码,然后还使用了具有git凭据的 HTTPS执行了git命令(主要是push)。

So far I am the only one using the repo. 到目前为止,我是唯一使用回购协议的人。

I used root account(though is not advisable for security reason) as it is simply a test-project repo and still getting familiar with AWS, for the first repository. 我使用了root帐户(尽管出于安全原因不建议使用),因为它只是一个测试项目存储库,并且对于第一个存储库仍然熟悉AWS。 Then as it simple to set up for use SourceTree(and I everything was ok following these instructions and also Pycharm I set access to this repo1 via HTTPS. 然后,设置要使用SourceTree的过程很简单(我按照这些说明以及Pycharm的一切都很好,我通过HTTPS设置了对此repo1的访问权限。

I was, and still able to execute *git command to the remote branches. 我曾经并且仍然能够对远程分支执行* git命令。 No problem at all. 没问题

Then after few months I decide to have another repo, in the same account(a root one). 然后几个月后,我决定在同一个帐户(root用户)中拥有另一个存储库。 This time I decide to go though directly to use HTTPS via git credentials. 这次,我决定直接通过git凭据使用HTTPS。 Followed same procedure, but this time I messed up, not I have this 遵循相同的步骤,但是这次我搞砸了,不是我有这个

在此处输入图片说明

executing 执行

git remote -v

So I have unwanted "origin" repo, that is not visible on AWS, and was made because I followed normal instructions. 因此,我有不需要的“原始”存储库,该存储库在AWS上不可见,并且是由于遵循正常说明而生成的。 Except that, it seems as it should be. 除此之外,它看起来应该是应该的。 Unfortunately since I tried to add the bees.txt, SourceTree is hunging without asking me to add or commit the file, and adding it manually I get this: 不幸的是,由于我尝试添加bees.txt,所以SourceTree挂起,而没有要求我添加或提交文件,并且手动添加它,我得到了:

fatal: Unable to create 
'C:/Users/Carmine/.virtualenvs/DL/Scripts/src/.git/index.lock': File 
exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.

(it seems is trying to alterate, so indeed adding a new file, the index, but the same is busy with something so, cannot proceed). (似乎正在尝试更改,因此确实添加了新文件索引,但是由于忙于某些事情,因此无法继续进行)。

Update-Solution 更新的解决方案

I get rid of git error executing as here 我摆脱了这里执行的git错误

Then through command line I added the test file and committed test file. 然后通过命令行添加了测试文件和已提交的测试文件。 Then as the repository was an already filled in with files, I added them. 然后,由于存储库中已经充满了文件,因此我添加了它们。

Later I pushed everything to remote master branch. 后来我将所有内容推送到远程主分支。 After that I manually deleted from SourceTree the unwanted(but not sincronized) remote/ mirror repository. 之后,我从SourceTree中手动删除了不需要的(但未同步化的)远程/镜像存储库。 Now everything seems works, so I was able to connect via HTTPS to AWS 现在一切似乎正常,因此我能够通过HTTPS连接到AWS

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用具有https凭证的GitPython克隆AWS CodeCommit git存储库 - Clone AWS CodeCommit git repository using GitPython with https credentials 为 AWS CodeCommit 生成 HTTPS Git 凭证:AWS 编程访问 - Generate HTTPS Git credentials for AWS CodeCommit: AWS Programmatic access 将Git Repo直接镜像到AWS CodeCommit - Mirror a Git Repo directly to AWS CodeCommit git 克隆到 AWS Codecommit 存储库返回 403 - git clone to AWS Codecommit repo returns 403 无法使用git协议推送到git,起源是https? - Can't push to git using git protocol, origin is https? AWS仅使用角色即可对CodeCommit存储库进行跨帐户访问(无静态凭证) - AWS cross account access to CodeCommit repo with roles only (no static credentials) 尝试使用git协议克隆存储库会导致https错误? - Trying to clone a repo using git protocol leads to https error? 在本地计算机上运行的 git 命令覆盖 aws codecommit repo 文件夹 - aws codecommit repo folder override by git command run on local computer AWS:无法克隆回购代码提交,请求的URL返回错误:403 - AWS: Can't clone repo Codecommit, The requested URL returned error: 403 AWS CodeCommit - 致命:未找到存储库“https://git-codecommit.us-east-1..” - AWS CodeCommit - fatal: repository 'https://git-codecommit.us-east-1..' not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM