AWS EB CLI + Codecommit:git状态在部署后错误地显示分支不同步 [英] AWS EB CLI + Codecommit: git status incorrectly shows branch out-of-sync after deploy

查看:192
本文介绍了AWS EB CLI + Codecommit:git状态在部署后错误地显示分支不同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用集成到源代码控制的eb deploy之后,CodeCommit远程仓库被更新(我可以在AWS Console中看到提交在那里,在云仓库中),并且EC2实例正确运行新的部署版本



问题:所有的东西都是同步的,但GIT说远程回购是其中的一件事实际上是是的。



当我输入git status时,它会显示:
您的分支在1次提交之前领先于'codecommit-origin / master'。
(使用git push发布你的本地提交)

当我输入git log codecommit-origin / master是不显示上次提交。



为什么GIT会说我的本地仓库远离遥控器,当AWS控制台清楚地显示远程CodeCommit仓库是最新的?可能是推到CodeCommit的eb deploy实际上不是一个git push命令吗?

当您在执行eb init和当您进入此部分时:
$ b blockquote>

注意:Elastic Beanstalk现在支持AWS CodeCommit;一个完全管理的源代码管理服务。要了解更多信息,请参阅文档: https://aws.amazon.com/codecommit/
您是否希望继续使用CodeCommit?


您应该回答否(N)。这样,eb不会产生另一个原点(codecommit-origin)。



我做到了这一点:

1.从CodeCommit repo。

2. eb init不带CodeCommit。

3.创建分支(例如开发,git分支开发)。
4. eb use development- env

5. eb deploy


After using "eb deploy" integrated to source control the CodeCommit remote repo is updated (I can see in AWS Console that the commit is there, in the cloud repo) and the EC2 instance is correctly running the new deployed version (can see it also through AWS Console).

The problem: all things are synced but GIT says the remote repo is one commit behind it is actually is.

When I type "git status" it says: Your branch is ahead of 'codecommit-origin/master' by 1 commit. (use "git push" to publish your local commits)

When I type "git log codecommit-origin/master" is does not show the last commit.

Why is GIT saying my local repo is ahead of remote when clearly in the AWS Console the remote CodeCommit repo is up-to-date? Could be that "eb deploy" pushing to CodeCommit is not actually a "git push" command?

解决方案

When you are doing eb init, and when you come to this part:

Note: Elastic Beanstalk now supports AWS CodeCommit; a fully-managed source control service. To learn more, see Docs: https://aws.amazon.com/codecommit/ Do you wish to continue with CodeCommit?

you should answer no (N). That way, eb won't make another origin (codecommit-origin).

I do it whis way:
1. git clone from CodeCommit repo.
2. eb init without CodeCommit.
3. create branch (eg. development, git branch development).
4. eb use development-env
5. eb deploy

这篇关于AWS EB CLI + Codecommit:git状态在部署后错误地显示分支不同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆