为什么git子树缺少提交? [英] Why is git subtree missing commits?

查看:151
本文介绍了为什么git子树缺少提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在主分支上运行了 git subtree split ,但子树( dist 分支)缺少最后一个两个提交在 master 分支上。我不知道这里要做什么。我以前没有遇到过这个问题。它总是没有问题。



以下是我的github网络图(不包括 dist ):





从主分支中,我运行 git subtree split -P dist -b dist



如果我从 dist 分支运行 git log ,它显示最近的提交是 6d1620a 。哪里是 17c1f31 33dfc67



任何人都知道什么是在这里?




更多细节特定于我的情景



我正在使用Yeoman生成的项目使用的部署方法。基本上这意味着我有一个总体项目文件夹,其中有一个 dev (或 app )目录,其中所有的开发都是完成和一个 dist 目录,这是项目建立的地方(通过gulp构建过程)。所以要部署,我只需将 dist 目录关闭到它自己的分支,并将其推送到活动服务器。



看起来像这样:

  gulp 
git checkout master
git merge --no-ff dev
git subtree split -P dist -b dist
git push

或者 git subtree push -P dist origin dist 也可以。

解决方案

运行gulp构建过程。正因为如此,新提交并没有影响 / dist 目录。



有意义的是,传递一个不受它影响的目录。但提前不知道这种行为真的让我困惑。


I just ran git subtree split on my master branch but the subtree(dist branch) is missing the last two commits that are on the master branch. I'm not sure what to do here. I haven't run into this before. It's always worked without issue.

Here's what my github network graph looks like(excluding dist):

From the master branch I ran git subtree split -P dist -b dist.

If I run git log from the dist branch it shows the most recent commit is 6d1620a. Where is 17c1f31 and 33dfc67?

Anyone know what's going on here?


More Details Specific to my Scenario

I am using the deployment method used by Yeoman generated projects. Basically meaning that I have an overall project folder within which there is a dev(or app) directory where all development is done and a dist directory which is where the project is built to(via gulp build process). So to deploy I just split the dist directory off into it's own branch and push that to the live server.

Which looks something like this:

gulp
git checkout master
git merge --no-ff dev
git subtree split -P dist -b dist
git push

Alternately git subtree push -P dist origin dist also works.

解决方案

I forgot the run the gulp build process. Because of this the new commit did not affect the /dist directory.

It makes sense that the commit wouldn't be passed on with a directory that was not affected by it. But not knowing this behavior ahead of time really confused the situation for me.

这篇关于为什么git子树缺少提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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