Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upCan't checkout PR when there are untracked files #1271
Closed
Comments
This was referenced Nov 7, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The extension often won't let me checkout PR branches.
This can be due to trivial things like build artifacts being added to the staging area.
This can be caused by build artifacts/tools (NCrunch) adding files to the working directory. Untracked files usually wouldn't be a problem when using Git from the command line, they can be a real nuisance when using the extension.
This is particularly problematic when the untracked files appear in submodules. The Git command line arguments necessary to clean them up aren't at all obvious (to me at least).
The current check is done here:
VisualStudio/src/GitHub.App/Services/PullRequestService.cs
Line 89 in a480116
It uses
IsDirty, which checks for any differences between the working directory/index and the last comment. By default, command line Git will allow a checkout if there are untracked files in the working directory.This issue is even more insidious when an untracked file gets added to a submodule. Here I'ved added
foo.txtto thesplatsubmodule.Visual Studio (below) and the Git command line doesn't give much of a clue as to what's going wrong. You can see that something might be up with the
splatsubmodule, but it doesn't give any indication of exactly what.