Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git isn't detected inside dev container in visual studio code

Git is not detected when I open dev container in VisualStudio Code even when I cloned the file from GitHub using SSH key.

Docker Desktop is working fine, also Everything is working fine as I can perform build, clean and test.
I cannot commit changes because there is not git repository.

No Git in DevContainer:
shows no git

Local filesystem with cloned files:
cloned file

I'm new to this. If anyone can help.

like image 948
Devid Karki Avatar asked Mar 15 '26 23:03

Devid Karki


1 Answers

Developping inside a container means you need to Open a Git repository or GitHub PR in an isolated container volume#, in order for your container filesystem to mount the right local folder (the one with a .git in it)

https://code.visualstudio.com/assets/docs/remote/containers/architecture-containers.png

Start VS Code and run Remote-Containers: Clone Repository in Container Volume... from the Command Palette (F1).

like image 72
VonC Avatar answered Mar 17 '26 23:03

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!