Skip to content
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

[DOC] - Add details on using git in code-server #486

Open
1 task done
kcpevey opened this issue Jul 22, 2024 · 2 comments
Open
1 task done

[DOC] - Add details on using git in code-server #486

kcpevey opened this issue Jul 22, 2024 · 2 comments

Comments

@kcpevey
Copy link
Contributor

kcpevey commented Jul 22, 2024

Preliminary Checks

Summary

The VSCode git extension works but there are some nuances about using it within Nebari that may be helpful to know.

Cloning a git repository

If you've never been to VSCode on Nebari before, you'll get the "Welcome Screen". This is the view of the welcome screen on a first login after clicking the git extension on the left sidebar":
image

From here, you can "Clone Respository" either through the extension panel on the left OR through the Welcome Screen UI on the right.

Its worth noting that the above workflow is only available on first login since Nebari will remember your previous workspace and will open it instead of the Welcome Screen. You can either get a clean workspace by going to "File" -> "New Window", or try the alternative below.

The other alternative is to go "View" menu -> "Command Pallette" and search for the "Git: Clone" option.
image

This will allow you to clone an external git repository:
image

After cloning the repositories will appear in the extension UI on the left:
image

GitHub login

If you select the option to "Clone from GitHub" you'll be given an opportunity to authenticate to GitHub which will allow you to pull private repos. I was able to go through that process succesfully.

GPG keys

The documentation on the git extension indicates that GPG keys can be used, but I ran into errors with that process. That will need more investigation.

Steps to Resolve this Issue

.

@kcpevey
Copy link
Contributor Author

kcpevey commented Jul 23, 2024

A few more details on gpg keys:

VS Code allows the usage of gpg keys, you just need to set Enable GPG signing to True in the settings.

VS Code on Nebari only loads the ~.bashrc, not ~/.bash_profile. GPG signing on Nebari requires running export GPG_TTY=$(tty) which is typically placed in ~/.bash_profile. In order to source the .bash_profile in VS Code terminals you can add this to your settings.json (gpg enabling also shown here for reference):

{
    "git.enableCommitSigning": true,
    "terminal.integrated.defaultProfile.linux": "bash",
    "terminal.integrated.profiles.linux": {
      "bash": {
        "path": "/bin/bash",
        "icon": "terminal-bash",
        "args": ["-l"]
      }
    },
}

This will ensure that bash is the default profile and will source the .bash_profile (based on this post)

settings.json is located at .local/share/code-server/User/settings.json on nebari.

This works well for the "regular" VS Code terminal, but it DOES NOT seem to be working for the "Output" interface of VS Code.

image

More investigation is needed to understand how the "output" interface is different from the "terminal".

@kcpevey
Copy link
Contributor Author

kcpevey commented Jul 29, 2024

I thought perhaps the "source control"/git extension was using the automation profile so I also added this to my settings:

    "git.terminalAuthentication": false,
    "terminal.integrated.automationProfile.linux": {
      "path": "/bin/bash",
      "args": ["-l"]
    }

This still didn't get past the GPG error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo 📬
Development

No branches or pull requests

1 participant