2

我正在开发 Ubuntu 12.04 LTS 上的 Openstack dev。我修复了一个小错误。在审查更改后,该错误又回来了。我进行了更改并将其推送到 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

感谢任何输入!

4

2 回答 2

2

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

删除 .gitignore 的形式是不够的。

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

于 2013-07-06T07:43:49.867 回答
1

问题在于,一旦我更新了第二组评论评论,我的 bug 分支上有两个提交。提交第二组更改后,现在,我不得不做一个变基,

git rebase -i HEAD^2

在此消息中,出现了两个提交,您必须压缩较旧的提交。这样做之后,我不得不修改我的提交使用

git commit --amend

然后推送它以供审查使用,

git review

这将更新最近的更改。

于 2013-07-11T13:52:10.450 回答