on 2023 Jul 28 8:46 PM
Hello fellow developers,
I have downloaded and installed git for Windows 10 64-bit from Git - Downloads (git-scm.com) but some commands like cp or grep do not work. Does anyone have an idea why and how I can work around this?
Is there a Windows equivalent of cp -r .gitignore $(ls -1A | grep -v .git) ../cpapp that will work in git BASH for Windows?
Thank you.
Best Regards,
Leila
Request clarification before answering.
Hello Leila,
Just to clarify, cp and grep are not git commands, they're unix commands. However, GIT Bash has ported some Unix commands to Windows, which allows you to use them on windows if you have Git Bash installed .
The reason you might be experiencing issues is that these commands are located in a specific path inside the installation folder for Git Bash. In my case, I installed it to E:\Program Files. If you navigate to that directory and then go to usr/bin, you'll find the executables for cp, grep, and many others:
If you want those commands to work in your windows console regardless of the directory you're in, you must add the directory to the windows path:
Once you do that, restart your windows console and the commands should be available.
If you're not sure how to add a path to the windows path, here's a quick tutorial you can follow:
https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/
By the way, if you're planning to follow SAP's CAP tutorials, I highly recommend using Business Application Studio (BAS) on BTP instead of a local Vscode installation. BAS already includes everything you need to start working without spending too much time on installing or troubleshooting tools. To get you started with BAS for CAP, here are some useful tutorials:
BAS Setup for the first time in your BTP trial Account:
https://developers.sap.com/tutorials/appstudio-onboarding.html
Create a dev space for CAP programming and your first application:
https://developers.sap.com/tutorials/hana-cloud-cap-create-project.html
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Edgar,
Thank you very much for the great information. You are right, I checked my directory under program files, and strangely all the paths for the tools I installe (e.g. node.js and even Git\cmd) were added except for the path to usr/bin. I added it and now I can find the commands.
Thank you also for the additional information about bash. I am familiar with bash as a command line language for Unix/Linux OS. However, these days I only have access to Windows which is why I have to add them when I need them.
Thank you again for your help and the excellent information.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
49 | |
10 | |
8 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.