Visual Studio 2015 Git error message “Cannot pull/switch because there are uncommitted changes”

For me I didn’t have any uncommitted changes or any untracked files, and Visual Studio 2015 still presented the warning. Close the solution in Visual Studio, exit Visual Studio. Open Git Bash (or your favorite Git UI) Navigate to your repository (or open the repository with the Git UI) git pull (or perform pull on the Git … Read more

How to pull into not-the-current-branch?

git fetch -u origin master:master Merge, update, and pull Git branches without using checkouts git fetch -u <remote> <remoteBranch>:<localBranch> The -u or –update-head-ok ensures that the command still works even if you have the given branch checked out, which otherwise gives the error: fatal: Refusing to fetch into current branch refs/heads/master of non-bare repository

Get back the changes after accidental checkout?

Another thing you can look at is through your IDE. I accidentally checkout 2 files and was able to bring back the changes through the ‘local history’ of my IDE (Netbeans). What a blessing! If you’re using Eclipse, do this by right clicking on the file and going to Team->Show Local History.

Is there a way to use wildcards with git checkout?

Git does deal with wildcards, using fnmatch(3). See the pathspec entry in Git glossary. But to be sure that git can see the wildcards, they must be escaped otherwise your shell will expand them first. Typically, I use wildcards between single-quotes: git checkout myBranch — ‘*/myFile.md’ The wildcards are applied to the whole name, directories … Read more