0

I installed Git For Windows 2.7.2 a few days ago. Now I have some problems with using optional tools Git For Windows provides from cmd.exe. In the previous version of Git For Windows(or say msysgit), I could configure these tools by modifying Git/etc/git-completion.bash. For example:

alias ls='ls --show-control-chars --color=auto'

I used this way to make ls display file names that contained Chinese characters normally. Now it seems this way doesn't work. In fact there is no git-completion.bash under Git/etc/. There is a git-completion.bash under the folder Git/mingw64/share/git/completion. I tried to copy it to Git/etc and add the alias above, which didn't work either. These tools only works fine in Git Bash. So how should I configure these tools together with git to use them from cmd.exe?

chihyang
  • 187
  • 6
  • There is a [duplicate](http://superuser.com/questions/602872/how-do-i-modify-my-git-bash-profile-in-windows) of this question on superuser. – Jeremy Fortune Feb 28 '16 at 13:20
  • I tried both of the answers. Seems neither works for `Git 2.7.2`. Everything only works fine in `Git Bash`. – chihyang Feb 28 '16 at 13:33
  • So you're looking to access these aliases from a Windows shell? – Jeremy Fortune Feb 28 '16 at 21:22
  • Yes, it's convenient if these aliases can be accessed from a Windows shell. In previous versions bashrc worked. But in Git 2.7.2 the configuration doesn't work. – chihyang Feb 29 '16 at 00:29

1 Answers1

1

This answer explains why you no longer have this functionality. In short, msysgit provided a unix shell emulator, mingw. Git for Windows is git compiled in a Windows environment.

Therefore, ls is simply an alias for dir in a Windows shell, not mingw's ls. If you want to create some Windows aliases, you can use doskey. Here's an answer for that.

Alternatively, I would suggest that you just start using PowerShell, where you'll be able to set up the $profile variable with some powerful commands like these.

Community
  • 1
  • 1
Jeremy Fortune
  • 2,459
  • 1
  • 18
  • 21