Use git installed in Windows Subsystem for Linux in VSCode - visual-studio-code

I installed git through WSL2:
Arch Linux on Windows 10 x86_64 with 4.19.84-microsoft-standard
$ which git
/usr/sbin/git
From cmd I can either use git via wsl.exe git ... or via a batch file I made to access wsl programs:
> wsl git status
On branch next
...
> git.bat status
On branch next
...
However git does not work:
Looking for git in: C:\Program Files\Git\cmd\git.exe
Looking for git in: C:\Program Files (x86)\Git\cmd\git.exe
Looking for git in: C:\Program Files\Git\cmd\git.exe
Looking for git in: C:\Users\x\AppData\Local\Programs\Git\cmd\git.exe
Git installation not found.
What I tried so far:
I moved my git.bat to C:\Users\x\AppData\Local\Programs\Git\cmd\git.bat
I put an explicit git path in the settings json:
{
"git.enabled": true,
"git.path": "C:\Windows\System32\wsl.exe git",
// ...
}
Which does not work either:
Looking for git in: C:\Windows\System32\wsl.exe git
Looking for git in: C:\Program Files\Git\cmd\git.exe
Looking for git in: C:\Program Files (x86)\Git\cmd\git.exe
Looking for git in: C:\Program Files\Git\cmd\git.exe
Looking for git in: C:\Users\x\AppData\Local\Programs\Git\cmd\git.exe
Git installation not found.
What can I do if I don't want to install git for Windows?

Fixed it using
VSCode: use WSL Git instead of Git for Windows
https://github.com/andy-5/wslgit

Related

I cant Install NvChad ( linux ). init.lua is not detected by neovim

I'm trying to install NcChad on neovim with the following command:
git clone https://github.com/NvChad/NvChad ~/.config/nvim --depth 1 && nvim
It doesn't work. I think it's because neovim can't find the init.lua file. When I rename this file to init.vim and enter neovim, it finds the file and gives an error.
Why can't neovim find init.lua?

VSCode asdf-vm command no such file or directory

Specs
VSCode 1.63.2
Homebrew 3.3.10
asdf 0.9.0
MacOS Monterey
Problem
I installed asdf via Homebrew as per doc http://asdf-vm.com/guide/getting-started.html#_3-install-asdf
The asdf command works well in my iTerm. However, it didn't work when committing or pushing via VScode terminal and VSCode source control.
The error from VSCode terminal
Unknown command: `asdf exec npm run pre-commit`
/usr/local/Cellar/asdf/0.9.0/libexec/bin/asdf: line 82: /usr/local/opt/asdf/lib/commands/command-help.bash: No such file or directory
And this below from VSCode source control
The error I got in output.
> git push origin feature/my-branch
Unknown command: `asdf exec npm run pre-commit`
/usr/local/Cellar/asdf/0.9.0/libexec/bin/asdf: line 82: /usr/local/opt/asdf/lib/commands/command-help.bash: No such file or directory
Running asdf exec npm run pre-commit in my iTerm works well. There must be different configuration between zsh in iTerm vs in VSCode. šŸ¤”
My attempt so far is to add this configuration in VSCode settings.json
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.defaultProfile.osx": "zsh"
but still not working
My ~/.zshrc setup for asdf
. /usr/local/opt/asdf/libexec/asdf.sh
What is the possible cause here?
Found dubious decision
I also dont have commands folder in asdf/lib
So I copied the same from asdf/libexec/lib
And it worked

How can I fix [Ycm] Invalid ycm path in vs code?

In Vs code whenever i open VS code application this message is pop up.
[Ycm] Invalid ycm path
What is the meaning of this message and how do i can fix this?
Hiļ¼ŒI have fixed this noteļ¼Œbut looks like ycm does not work.
--
I use this link to fix.
My command have some differences.
git clone https://github.com/Valloric/YouCompleteMe.git
cd YouCompleteMe
git submodule update --init --recursive
cd third_party
mkdir ycmd_build
cmake -G "Unix Makefiles" . /Users/xx/software_cfg/ycm/YouCompleteMe/third_party/ycmd/cpp
Then copy 'ycm_core.cpython-310-darwin.so' to VS Code ycmd path.
--
After these settingļ¼ŒI found ycm still not work.
Just add one dir path in [Ycmd: Path], the note will disappear.

clone fails with "smudge filter lfs failed (...) HTTP_1_1_REQUIRED"

I'm trying to clone a git repo from my corp locally-hosted TFS/devops. However, I get failure:
batch response: Post (...) HTTP_1_1_REQUIRED
I saw recommendation to skip smudge by running git lfs install --skip-smudge
or setting GIT_LFS_SKIP_SMUDGE=1, but then the lfs-provided binaries don't get pulled and I get compile errors.
Solution - Before clone, run: git config --global --replace-all http.version HTTP/1.1
Ref, from the git-lfs developer which added the http.version option: https://github.com/git-lfs/git-lfs/issues/3875#issuecomment-607260728

Cyclone DDS Package configuration file missing

I'm a beginner looking for some clarity on how to create and run Example for Cyclone DDS
I had build cyclone dds with visual studio 2019, after build i was trying to build and run the basic helloword example
im getting following error when i try to do so. Im pretty much new to Cmake and stuff, can any one help in resolving this error ?
rkpsr#Rahul MINGW64 ~
$ cd cyclonedds
rkpsr#Rahul MINGW64 ~/cyclonedds (master)
$ cd examples
rkpsr#Rahul MINGW64 ~/cyclonedds/examples (master)
$ cd helloworld
rkpsr#Rahul MINGW64 ~/cyclonedds/examples/helloworld (master)
$ cd build
rkpsr#Rahul MINGW64 ~/cyclonedds/examples/helloworld/build (master)
$ cmake ../
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042.
CMake Error at CMakeLists.txt:17 (find_package):
By not providing "FindCycloneDDS.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"CycloneDDS", but CMake did not find one.
Could not find a package configuration file provided by "CycloneDDS" with
any of the following names:
CycloneDDSConfig.cmake
cyclonedds-config.cmake
Add the installation prefix of "CycloneDDS" to CMAKE_PREFIX_PATH or set
"CycloneDDS_DIR" to a directory containing one of the above files. If
"CycloneDDS" provides a separate development package or SDK, be sure it has
been installed.
-- Configuring incomplete, errors occurred!
See also "C:/Users/rkpsr/cyclonedds/examples/helloworld/build/CMakeFiles/CMakeOutput.log".
rkpsr#Rahul MINGW64 ~/cyclonedds/examples/helloworld/build (master)
$