git - 如何将提交更改推送到 aws 远程服务器实例?
问题描述
我已经按照这些说明https://alphacoder.xyz/git-push-to-an-aws-ec2-remote-using-a-pem-file/。但它不起作用。
解决方案
最新的官方说明是Amazon Elastic Compute Cloud 上的“使用 SSH 客户端连接到您的 Linux 实例”。
这可能比 2017 年的帖子更可靠。
不要忘记在第一次连接时回答是(ssh -i /path/my-key-pair.pem my-instance-user-name@my-instance-public-dns-name
):
The authenticity of host 'ec2-198-51-100-1.compute-1.amazonaws.com (198-51-100-1)' can't be established.
ECDSA key fingerprint is l4UB/neBad9tvkgJf1QZWxheQmR59WgrgzEimCG6kZY.
Are you sure you want to continue connecting (yes/no)?
(yes)
Warning: Permanently added 'ec2-198-51-100-1.compute-1.amazonaws.com' (ECDSA) to the list of known hosts.
连接后,您需要生成一组不同的 SSH 密钥,以便将公共密钥注册到您的 GitLab 帐户,并在该实例上克隆 GitLab 存储库。
请参阅“ GitLab 和 SSH 密钥”。
我在带有 ssh 的 aws 实例远程服务器上有一个项目。我使用这个实例 ssh 将该项目下载到我的本地
如果您在本地复制 (scp) 远程 AWS 项目,您最终会得到 AWS .git 存储库及其设置,因此是远程 GitLab。
您需要在本地生成一个新的 ssh 密钥,将其注册到您的 GitLab 帐户,并在能够推送回 GitLab 之前使用它。
推荐阅读
- dataframe - Pyspark - 使用列表中的startswith创建一个新列
- f# - 如何将复杂的 Application Insights 引入 Farmer 部署?
- python - SqlAlchemy 函数元素。如何在课堂上放方法?
- .net - 具有强名称签名项目的批处理构建中的 dotnet build 命令
- android - StreamBuilder 没有从 FireStore 获取数据 | 扑
- django - 在 Django Rest Framework 上获取国外序列化的 ReadOnlyField
- azure - AD B2C 测试用户流不允许选择应用注册
- mongodb - 允许自定义 CRDT 合并的分布式数据库
- python - 优化计算文档频率
- python - django admin覆盖delete_model不适用于批量删除