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

Bug report: git checkout introduces local changes

From
AMAnthony Miles <anthony.miles@nab.com.au>
Date
Jan 13, 2021, 22:32 UTC
Message-ID
<ME2PR01MB32490F1D7657C6B6854A3B82D9A90@ME2PR01MB3249.ausprd01.prod.outlook.com>
Background: (from memory)
Branch A had a file X added to it
Branch B had a copy of the file X added to it (in a different location)
Later, Branch B was merged to branch A
Steps:
1. git checkout A
  No local changes
2. git checkout B
  File X is deleted

What did you expect to happen? (Expected behavior) Checking out a branch should not introduce local changes

What happened instead? (Actual behavior) Checking out branch B introduced a local change, deleting File X

Additional information: Switching back from branch B to branch A results in no local changes

[System Info] git version: git version 2.29.2.windows.2 cpu: x86_64 built from commit: 3464b98ce6803c98bf8fb34390cd150d66e4a0d3 sizeof-long: 4 sizeof-size_t: 8 shell-path: /bin/sh uname: Windows 6.1 7601 compiler info: gnuc: 10.2 libc info: no libc information available $SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe

[Enabled Hooks] pre-commit pre-push

The information contained in this email and its attachments may be confidential. If you have received this email in error, please notify the sender by return email, delete this email and destroy any copy.

Any advice contained in this email has been prepared without taking into account your objectives, financial situation or needs. Before acting on any advice in this email, National Australia Bank Limited (NAB) recommends that you consider whether it is appropriate for your circumstances. If this email contains reference to any financial products, NAB recommends you consider the Product Disclosure Statement (PDS) or other disclosure document available from NAB, before making any decisions regarding any products.

If this email contains any promotional content that you do not wish to receive, please reply to the original sender and write "Don't email promotional material" in the subject.

Message 1 of 1 in “Bug report: git checkout introduces local changes”
  1. Anthony MilesJan 13, 2021

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.