So this is definitely a Git Bash bug.ĮDIT 2: on Git Bash, adding "a/b b/c/file" works without errors, so it's really the space at the end of the directory name that causes the issue. So, bad news, you might not be able to checkout this file at all on Windows, although maybe a different client could manage it? This might be worth reporting as a bug to Git for Windows.ĮDIT: if I use Cygwin and its version of Git, the operations work correctly and I can add and commit the file, but then if I come back to Git Bash I get errors about that file all the time. However, `ls "a/b /c/file" confirms that the file exists on the file system. On Windows, git status gives me this warning message: warning: could not open directory 'a/b /': No such file or directory On Linux, git status now tells me I've added that file. In Git Bash and on Linux: mkdir -p "a/b /c" Add the path to git’s bin and cmd at the end of the string like this: C:Program FilesGitbin C:Program FilesGitcmd. Then, under System Variables, look for the path variable and click edit. I have created a similar situation and gotten a similar error. C:Program FilesGitcmd To add into PATH: Right-Click on My Computer. I believe this is a bug in Git for Windows. Perhaps the easiest for users to set up would be a git config entry, they do. From outside, you'll have to use convention, an environment var or a home-based conventional pathname or some such. You dont have to guess anymore which config has been set to where, with git 2.8 (March 2016) See commit 70bd879, commit 473166b, commit 7454ee3, commit 7454ee3 (), commit 473166b, commit 7454ee3 (), commit 7454ee3 (), and commit a0578e0 () by Lars Schneider (larsxschneider). And arguably, it's a bug in Git Bash and Cygwin Bash (both are based on the MSYS2 runtime so, really, a bug in the MSYS2 runtime) that they even let me create such files in the first place. From anywhere inside the repo you can get the /reponame prefix by running git rev-parse -show-toplevel. It's not a bug in Git that it won't create or manipulate such files, it's an OS limitation. While test tests in my original answer work as I describe, they miss the main point, raised by several different people: Windows does not allow filenames that end with spaces.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |