I am trying to run gitk.exe (the program installed with Git for Windows) from WSL 2. If I do this in a repository sitting on my WSL virtual drive, such as ~/path/to/repository, I get the error, "Cannot find a git repository here." However if I'm in a repository outside of the virtual drive, i.e., /mnt/c/path/to/repository, gitk.exe works just fine even though I'm still running it from WSL. How can I get gitk.exe to work on repositories in my WSL filesystem?
gitk: "Cannot find a git repository here" when running in WSL 2
1.2k views Asked by Andymang At
1
There are 1 answers
Related Questions in GIT
- problem to push files on a repository git
- diff3 output in git conflict style, including mergeable hunks
- Git Not In Sync with Local Branch
- Setting up the version control of .dotfiles while the .config is connected to a forked repo
- How to fix overriding the main branch in Git?
- I can't add text to "Message" in VS Code when committing to Git
- How can i redirect pull request from main branch to another branch
- Xcode commits (possibly outside of any branch) disappeared, how to get them back?
- Git/TortoiseGit : how to apply ONLY the changes from ONE commit from branch A, to branch B?
- How can I reintroduce username an password on git using fedora?
- GIT SKIP EMPTY DIRECTORIES
- Git smudge run once per checkout or per commit?
- I can't find ~/.profile or ~/.bashrc in C:/Users/<user>/.ssh folder
- Set environment variable during push for GitHub Actions
- Android WebRTC compile
Related Questions in WSL-2
- Ubuntu-22.04 File watcher failed repeatedly and has been disabled (External file changes sync might be slow)
- I'm unable to access 'https://github.com/Danniecodjoe/alx-system_engineering-devops.git/':
- Installing Docker on Windows 10
- Error "libicui18n.so.73: cannot open shared object file" after installing Node.js via Homebrew on Windows Subsystem for Linux (WSL)
- Buildx error when deploying models in Nuclio(CVAT)
- Appending File Path (With Spaces) to $PATH Variable Removes the Spaces
- How do I set up Xdebug in PhpStorm with Laravel Sail Docker on WSL2 without Docker Desktop
- trivial socket program failing at accept() with errno 22
- Docker and WSL consumes lot of space in C Drive and Ubuntu not working error
- mysql and databases with wsl and visual studio
- I can“t clone my github repository with a ssh key
- How can I access running docker container instead of Apache2 Ubuntu default page?
- POST requests to api.cognitive.microsofttranslator.com from docker in WSL2 with mirrored networking not working when wireguard VPN enabled
- sail fails to build docker image
- How to debug a Magento 2 project on Visual Studio or PhpStorm in Windows 10 with WSL2 Environment using Nginx and PHP 8.1?
Related Questions in GITK
- How to create a gitk view which always shows work done so far on an interactive rebase (with -i or --interactive option)
- How to use tools like gitg and gitk in windows with wsl ubuntu 22.04?
- Use the patience algorithm with gitk
- Git-Gui / Gitk Broken interface cause crash on kde plasma wayland
- Does `gitk` have an option to automatically refresh its view (every 2 seconds, for example)
- How to build gitk?
- I can't delete this Git detached head
- Can't open gitk
- Everything up-to-date, but i still get 1 commit ahead, 2 commits behind :/
- gitk: "Cannot find a git repository here" when running in WSL 2
- Alternate diff tool not firing from gitk for Windows
- How to fix gitk that suddenly has got broken with error: can't read "arcnos()": no such element in array
- gitk do not show the diff anymore. (Local changes checked in to index but not committed)
- What's the meaning of `@@ -6,7 +6,6 @@` in gitk's diff panel?
- gitk - don't show labels for branches that don't match glob or regexp
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
I found the problem. According to this answer, gitk runs git under the hood to determine if it's being run in a git repository. So, it's reasonable to think that gitk.exe would run git.exe-that is, the binary installed on Windows, not the binary installed from my package manager in the WSL virtual drive.
Running
git.exe statusfrom my ~/path/to/repository/ resulted in:To fix this I first tried running in WSL
But for some reason, that did not resolve the error. The next thing I tried was running the same command from a Git Bash window on Windows. After that, running
git.exe statusfrom WSL resulted inAnd with that,
gitk.exealso worked.This answer has some more information about the unsafe repository error.