1
* 14a95c1        (HEAD) min base
* e69ca3b        (testminify, master) modified base
* 71863ae        added compressor
* 2d2bc01        added changes
* d000d45        merge fixes
* 18847ab        (production/master) added couple of cdns
* 8f02c19        minified css files
* 276649a        added libs
* f4b9533        fixed fb
* 2b4b490        prod ready
* 685a99c        removed dj static from settings file
* 1f012bc        added mailing support
* eb69d26        modified wsgi and static files
* bbd5c76        settings
* 39b229b        deleted some files

我的 git 提交树如上,我想将testminiyproduction合并在一起。我尝试了以下

git checkout production

然后git merge testminify

但我无法让它工作,我希望生产分支位于顶部。由于我将生产推送到服务器。所以我想得到它如下,请让我知道,我错过了什么。

  • 14a95c1 (HEAD production/master) min base
  • e69ca3b 修饰碱基
  • 71863ae 增加压缩机
  • 2d2bc01 添加了更改
  • d000d45 合并修复
  • 18847ab 添加了几个cdns
  • 8f02c19 缩小的 css 文件
  • 276649a 添加了库
4

1 回答 1

2

With the example you provide, it looks like production is the name of the remote; git remote will list the remotes you have configured for that repository, and git remote show production will show details about the remote named production.

It seems like you have a local branch named master, which points to the same commit as testminify, so in other words it's already been merged in, at least locally. The master branch is (almost certainly) a local copy of the remote branch production/master.

What you need to do now is push your local changes to the remote. Your log suggests you'd need to do git push production master (push the changes made to the local master branch up to the production remote).

Edit: I had missed the part about the detached HEAD. In order to address this, you can reset master to point at that commit before you push:

git checkout -B master # master is now at 14a95c1
于 2013-07-19T20:31:15.277 回答