git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git-checkout -B resets branch not showing last revision

From
HDHaralan Dobrev <harry@hkdobrev.com>
Date
Apr 17, 2018, 08:31 UTC
Message-ID
<CANu1nimmRCkudQyW8fksg9LRu3tdoSV93S6PD7U_tJ82Vk4kZA@mail.gmail.com>
Hi,
I recently had the following case:
1. I have a local branch called `foo` which I haven't checkout recently.
2. Due to a bad alias I ran the following command:
    git-checkout -B foo

This checked out and reset the foo branch. Which is according to the documentation. However, the output of the command does not show the previous state of the foo branch unlike what `git-reset --hard` does for some time.

The previous revision is not present in the `reflog` either as I haven't checked it out.

I think it would be beneficial to Git users to show the previous revision in all operations resulting in reseting a branch.

Thanks, Harry

Next: Junio C Hamano
Message 1 of 2 in “git-checkout -B resets branch not showing last revision”
  1. Haralan DobrevApr 17, 2018
  2. Junio C HamanoApr 17, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.