-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using git (with SSH) in workspace #2266
Comments
Isn't your project's code mounted to the workspace container with a volume anyways? If you absolutely have to pull from inside the workspace container for some reason, you can check these snippets that show how to set the correct permissions and add a SSH key to the agent: https://gist.github.com/grenade/6318301 |
Isn't your project's code mounted to the workspace container with a volume anyways? So you should be able to regularly pull your code from bitbucket on your Windows host. It will update inside the container as well. If you absolutely have to pull from inside the workspace container for some reason, you can check these snippets that show how to set the correct permissions and add a SSH key to the agent: https://gist.github.com/grenade/6318301 Thanks for the link you gave me. However, I do not want to generate new keys. I want to use the keypair of my Windows host. So my question is, how to get my Windows host keypair into the |
Okay, I see. That could be annoying. Just curious, does syncing git via the VS Code GUI work?
I didn't link this gist for key generation purposes. There are three scripts. The first one is irrelevant for your case. The third one should help you to set permissions for SSH keys. You might need the second one to make sure git can use the key. This is supposed to prevent the wrong file permissions error you described. Fortunately for you, it seems like there is a complete solution in the VS Code documentation: https://code.visualstudio.com/docs/remote/containers#_sharing-git-credentials-with-your-container I am assuming you are using the There are other ways to share the SSH keys of your host when using the SSH extension. Please let me know if it works. |
Everything working now. Ended up using: https://code.visualstudio.com/docs/remote/containers#_using-ssh-keys Thanks. I was kind of confused since there are many ways to do this. I've been using https://github.com/cytopia/devilbox too, and that project had a very different solution for this particular problem. |
Info:
$ docker --version
): 19.03.0-rc2, build f97efcc$ git rev-parse HEAD
): cb910c5Since I'm using bitbucket with SSH I'm looking for the best approach to get my SSH keys into the
workspace
container. Is there any documentation about this? (couldn't find it)I already tried mounting my hosts
~/.ssh
to/root/.ssh/
which results in having the right keys in the workspace. However, when usinggit
commandsgit
starts complaining about wrong file permissions (as expected) because my host machine (Windows) isn't aware of file permissions as in Linux.Does someone have a working solution that we could add to the documentation?
The text was updated successfully, but these errors were encountered: