Thanks to visit codestin.com
Credit goes to github.com

Skip to content

git checkout hangs when its current working directory has no files in the target branch of the checkout command #1064

@wilbaker

Description

@wilbaker
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.11.1.windows.1
built from commit: 1c1842bcba45569a84112ec64f72b08eb2d57c68
sizeof-long: 4
machine: x86_64

  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?

Windows 10, 64-bit

$ cmd.exe /c ver

Microsoft Windows [Version 10.0.14393]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

C:\Repos\gvfsGitTest\Scripts>type "C:\Program Files\Git\etc\install-options.txt"
Path Option: Cmd
SSH Option: OpenSSH
CRLF Option: CRLFCommitAsIs
Bash Terminal Option: MinTTY
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
Enable Builtin Difftool: Disabled

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

No

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

CMD


C:\Repos>git clone https://github.com/git-for-windows/git
C:\Repos>cd git\xdiff
C:\Repos\git\xdiff>del *
C:\Repos\git\xdiff\*, Are you sure (Y/N)? Y

[NOTE: xdiff is a folder with no subfolders inside of it, only files]

C:\Repos\git\xdiff>git checkout -b b1
C:\Repos\git\xdiff>git commit -a -m "del"
C:\Repos\git\xdiff>git checkout master
C:\Repos\git\xdiff>git checkout b1

  • What did you expect to occur after running these commands?

The final "git checkout b1" command (see above) would complete

  • What actually happened instead?

The "git checkout b1" command hung

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

Not repo specific

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions