本地文件夹中的更改未反映在git,openstack上

时间:2013-07-06 06:51:37

标签: git gerrit openstack

我正在使用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

欣赏任何输入!

2 个答案:

答案 0 :(得分:2)

  

我发现拥有该文件的文件夹存在于.gitignore中。我删除了!问题仍然存在。

删除.gitignore表单是不够的。

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

答案 1 :(得分:1)

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

git rebase -i HEAD^2

在此消息中,出现了两个提交,您必须压缩旧提交。执行此操作后,我必须使用

修改我的提交
git commit --amend

然后使用

推送它进行审核
git review

这会更新最近的更改。