Question

So, recently I wanted to see what would happen if I merged two branches in git. I found this answer which suggests:

git merge --no-commit --no-ff $BRANCH

That told me that I have no changes between the branches. I thought this was reasonable (I knew that someone had merged them recently), but then when I used diff, I got results back. Here's the full output:

html 15:53:26 >> git merge --no-commit --no-ff dev_1_1
Already up-to-date.
html 15:54:33 >> git merge --no-commit --no-ff origin/dev_1_1
Already up-to-date.
html 15:54:40 >> git diff dev_1_1
diff --git a/html/sites/all/modules/client/client_feed/client_feed.module b/html/sites/all/modules/client/client_feed/client_feed.module
index 840deb8..fb88b96 100644
--- a/html/sites/all/modules/client/client_feed/client_feed.module
+++ b/html/sites/all/modules/client/client_feed/client_feed.module
@@ -743,7 +743,7 @@ function client_client_variable_info($options) {
     'default' => 'production',
     'description' => t('"development" or "production" (QA should be development)', array(), $options),
   );
-       
+
+
+/**
+ * Implements function for return select list with items.
+ *
+ * @param int $id
+ *   Taxonomy term id (tid).
+ *
+ * @return array $items
+ *   Array with items.
+ */
Was it helpful?

Solution

So, it turns out that the reason this came up was because the merge was from the wrong branch. If you have two branches which are starting at the same spot:

A   B
|   |
|   + Commit extra code
|   |

This will happen:

git checkout B
git merge --no-commit --no-ff A
# Already up to date
git diff A
# Everything from the extra commit
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top