【问题标题】:Changes in local folder not reflecting on git, openstack本地文件夹中的更改未反映在 git、openstack 上
【发布时间】:2013-07-06 06:51:37
【问题描述】:

我正在 Ubuntu 12.04 LTS 上开发 Openstack。我修复了一个小错误。在审查更改后,该错误又回来了。我进行了更改并将其推送到 gerrit 审查。现在的问题是,小改动没有上传到远程审核中。谷歌搜索后,我发现包含该文件的文件夹存在于 .gitignore 中。我删除了那个!问题仍然存在。它存在于本地副本上,但远程审查副本上不存在更改。 git log 指向最近的提交。这对本地副本有更改,而不是最终副本。!

akoppad@akoppad:/opt/stack/horizon$ git status
# On branch bug/1189393
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   .gitignore
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   static/
no changes added to commit (use "git add" and/or "git commit -a")
akoppad@akoppad:/opt/stack/horizon$ 

我上传补丁后,更改仍然不存在?我不确定发生了什么?

以下是整个过程的完整概要:

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch bug/1189393
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   openstack_dashboard/static/dashboard/less/horizon.less
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       static/


akoppad@akoppad:/opt/stack/horizon$ git status
# On branch bug/1189393
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   modified:   openstack_dashboard/static/dashboard/less/horizon.less
#   new file:   static/dashboard/css/339f94897afb.css
#
akoppad@akoppad:/opt/stack/horizon$ 
git log 


commit 0a46d93a186ca32523d2d6166246c279eabf54b8
Author: Annapoornima Koppad <a.koppad@gmail.com>
Date:   Sat Jul 6 12:07:23 2013 +0530

Added btn-create with btn-launch in loadbalancer dashboard

implements bug 1189393

Change-Id: Iceab75c34175677776107356435b421b54798e37

commit f2c7db09791dc8c4fb329f535c330bfd3bdf98f4
Author: Annapoornima Koppad <a.koppad@gmail.com>
Date:   Mon Jun 24 18:11:08 2013 +0530

Added btn-create loadbalancer dashboard

Fixes bug 1189393

Change-Id: Iceab75c34175677776107356435b421b54798e37

akoppad@akoppad:/opt/stack/horizon$ git commit -a
[bug/1189393 1e69613] There is an error with my git. The local changes are not reflecting on the review button. Please ignore if the changes that were asked are still not present on this commit.
 2 files changed, 5653 insertions(+), 1 deletion(-)
 create mode 100644 static/dashboard/css/339f94897afb.css

感谢任何输入!

【问题讨论】:

    标签: git gerrit openstack


    【解决方案1】:

    我发现包含该文件的文件夹存在于 .gitignore 中。我删除了那个!问题依然存在。

    从 .gitignore 中删除该表单是不够的。

    您需要添加并提交在.gitignore 文件中声明为忽略的文件夹或文件。

    【讨论】:

    • 感谢您的评论。我也添加并提交了特定文件。该特定文件在 git status 上显示为已修改,我将其添加到提交中。但是,提交仍然没有显示出来。
    • @Anuk 你推送那个提交了吗?
    • 我正在关注这个 gerrit 工作流程。它不会要求我将提交推送到任何地方。 wiki.openstack.org/wiki/GerritWorkflow。请帮忙,我已经被这个问题困扰了很长一段时间了。我添加了更多代码以使自己清楚。
    • @Anuk 在git status 之后,你做了 git 提交吗? (为了提交static目录中的文件,之前被忽略了)
    【解决方案2】:

    问题在于,一旦我更新了第二组审查 cmets,我的 bug 分支上有两个提交。提交第二组更改后,现在,我不得不做一个 rebase,

    git rebase -i HEAD^2
    

    在此消息中,出现了两个提交,您必须压缩较旧的提交。完成此操作后,我不得不使用

    修改我的提交
    git commit --amend
    

    然后将其推送以供审核,

    git review
    

    这将更新最近的更改。

    【讨论】:

    • 比我的回答更详细。 +1
    • @VonC,感谢您的帮助。 :) 阿努克
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多