Skip to content

Creating a branch from a commit / detached HEAD has an unexpected recent history #6335

Closed

Description

@donokuda

Description

When I create a branch from a "detached HEAD" state (such as from a commit), the branch is created with a different history (my assumption is that it's master or the default branch)

Version

  • GitHub Desktop: 1.5.0
  • Operating system: macOS 10.13.6

Steps to Reproduce

  1. Check out a commit in terminal (I did git checkout a813cc1 as an example) and switch to Desktop
    image
  2. In Desktop, create a new branch. Desktop should warn you that the new branch will be based off of the currently checked out commit.
    image
  3. After creating a new branch, look at the history.

Expected Behavior

I'd expect the latest commit to be the one that I checked out (I did git reset --hard a813cc1 to simulate this in the UI):
image

Actual Behavior

The latest commit in the branch is more recent than the one I originally checked out:
image

Additional Information

Logs

Activity

  1. billygriffin commented on Dec 4, 2018

    @billygriffin
    Contributor

    Thanks @donokuda!

    In Desktop, create a new branch. Desktop should warn you that the new branch will be based off of the currently checked out commit.

    Clarifying question on step 2. Is that the actual behavior or the behavior you think should happen?

    On the final "actual behavior," is the commit that was actually the most recent the one that's the latest on master? Just trying to understand specifically what's happening instead of what should happen.

  2. donokuda commented on Dec 4, 2018

    @donokuda
    ContributorAuthor

    Oops! I was vague on purpose because I didn't want to assume what was happening. 😅

    Clarifying question on step 2. Is that the actual behavior or the behavior you think should happen?

    This is the actual behavior.

    On the final "actual behavior," is the commit that was actually the most recent the one that's the latest on master? Just trying to understand specifically what's happening instead of what should happen.

    I believe that's the latest on master.

  3. tierninho commented on Dec 4, 2018

    @tierninho
    Contributor

    So I followed the steps and my outcome was the same as your Expected result (ie, branch is 8 days old, and so is last commit). If I switched branches back to master, the latest commits were shown.

    I did not use git reset --hard a813cc1 as I already arrived at the Expected result.

    Is this issue a dupe of this? #6085

  4. added
    more-info-needed
    on Dec 6, 2018
  5. donokuda commented on Dec 12, 2018

    @donokuda
    ContributorAuthor

    I just realized that I didn't include the initial history in the first screenshot, which probably doesn't help troubleshooting.

    Here's a gif reproducing the issue that I'm running into:

    kapture 2018-12-12 at 13 29 36

    Is this issue a dupe of this? #6085

    Seems like it if the issue is confirmed.

  6. added
    investigation-needed
    and removed
    more-info-needed
    on Dec 24, 2018
  7. sergiou87 commented on Sep 19, 2024

    @sergiou87
    Member

    Can't reproduce this anymore 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    investigation-needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions