Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5939875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:53:23+00:00 2026-05-22T15:53:23+00:00

In the following example, is there a way to know a merge happened? Looking

  • 0

In the following example, is there a way to know a merge happened? Looking at git log, I can’t tell I merged.

# setup example directory
$ mkdir test
$ cd test
$ git init
$ touch a
$ git add a
$ git commit -m "1"

# switch to different branch
$ git checkout -b topic
$ touch b
$ git add b
$ git commit -m "2"

# go back to master and merge
$ git checkout master
$ git merge topic

# git log

commit cccc64de3947828f487a8ce3c3e72b0f68dc88c3
Author: none
Date:   Fri May 20 05:54:45 2011 -0700

    2

commit a5d57454295759609d91a60219002e74016eed2b
Author: none
Date:   Fri May 20 05:54:29 2011 -0700

    1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:53:23+00:00Added an answer on May 22, 2026 at 3:53 pm

    In that instance, git has spotted that it’s possible to do a so-called “fast-forward” merge, since the branch you’re merging in already contains everything in the current branch – it doesn’t need to create a new commit in the commit graph to join the two branches.

    If you don’t like that behaviour, and want create a merge commit even when fast-forwarding is possible, you should merge in the other branch with:

    git merge --no-ff topic
    

    However, if you really need to know whether a merge happened or not, you can find that information in the “reflog”. For example, in your situation, git reflog would produce the following output:

    1eecbcb HEAD@{0}: merge topic: Fast-forward
    193ae5e HEAD@{1}: checkout: moving from topic to master
    1eecbcb HEAD@{2}: commit: 2
    193ae5e HEAD@{3}: checkout: moving from master to topic
    193ae5e HEAD@{4}: commit (initial): 1
    

    … which shows you how HEAD was changed recently, and what action caused that to happen. However, relying on the reflog is generally a bad idea except in particular situations, such as recovering from errors – it’s better to just think in terms of the commit graph, and make that represent what you’ve done. git merge --no-ff is one such method that lots of people like.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I remove the unwanted whitespace in following example? Note 1. that there
Is there a pythonic way (I know I can loop using range(len(..)) and get
Is there any way to remove variable i in the following example and still
Say, there is a following example: class Super { public int i = 3;
I'm trying to implement a delegate class following Herb Sutter's Example . There is
I need to calculate the directory size in VB .Net I know the following
Is there a simpler way to write the following regular expression, specifically avoiding all
I would like to know if there's any way to specify an inline array
I know that there is a way to make any defined URL resolve to
I'm new to java and I wonder if there is simple way to know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.