Skip to main content

Personalizing GitHub Codespaces for your account

You can personalize GitHub Codespaces by using a dotfiles repository on GitHub Enterprise Cloud or by using Settings Sync.

About personalizing Codespaces

When using any development environment, customizing the settings and tools to your preferences and workflows is an important step. GitHub Codespaces allows for two main ways of personalizing your codespaces.

  • Settings Sync - You can synchronize your Visual Studio Code settings between the desktop application and the VS Code web client.
  • Dotfiles – You can use a dotfiles repository to specify scripts, shell preferences, and other configurations.

GitHub Codespaces personalization applies to any codespace you create.

Project maintainers can also define a default configuration that applies to every codespace for a repository, created by anyone. For more information, see "Einführung in Entwicklungscontainer."

Settings Sync

Settings Sync allows you to synchronize configurations such as settings, keyboard shortcuts, snippets, extensions, and UI state across machines and instances of VS Code. For more information, see Settings Sync in the VS Code documentation.

Deine synchronisierten Einstellungen werden in der Cloud zwischengespeichert. Wenn die Einstellungssynchronisierung in einem Codespace aktiviert ist, werden alle Updates, die du an deinen Einstellungen im Codespace vornimmst, in die Cloud gepusht, und alle Updates, die du von einem anderen Ort in die Cloud pushst, werden in deinen Codespace gepullt.

For example, a common use of Settings Sync would be to sync your settings from your VS Code desktop application, which you use for local work, to codespaces you open in the browser. To do this, you would need to do the following things.

  • Turn on Settings Sync in the desktop application. For more information, see Settings Sync in the VS Code documentation.
  • Enable Settings Sync in your user preferences for GitHub Codespaces. For more information, see "Managing your preferences for Settings Sync."
  • Optionally, if you want to sync settings changes back to your desktop application from a codespace, turn on Settings Sync in the codespace and add the repository from which you created the codespace to your list of trusted repositories. For more information, see "Turning on Settings Sync in a codespace."

Alternatively, you may want to use the same settings across all codespaces you open in the web client, while leaving your local VS Code application unaffected. To do this, you would need to do the following things.

  • In a codespace, configure your settings as you want them, then turn on Settings Sync in the codespace to push the settings to the cloud. When you do this, Settings Sync is enabled automatically in your user preferences for GitHub Codespaces, so your settings will be pulled into all new codespaces. For more information, see "Turning on Settings Sync in a codespace."
  • In the desktop application, leave Settings Sync turned off, or sync your settings to a different account.

About Settings Sync in codespaces

Whether Settings Sync is turned on by default in a codespace, and the relationship between your cached settings and the settings in a codespace, depend on several factors. These factors include the editor in which you open the codespace, your user preferences on GitHub, and your list of trusted repositories.

For codespaces opened in the VS Code desktop application, Settings Sync remains on if you have previously turned on Settings Sync in the application. If Settings Sync is on, your settings are synced both to and from the cloud.

For codespaces opened in the VS Code web client, Settings Sync is disabled by default. This means the VS Code instance in the codespace uses the default theme and settings.

If you use the web client and want your codespaces to use your cached synced settings, you can enable Settings Sync in your user preferences on GitHub. For more information, see "Managing your preferences for Settings Sync." Settings Sync is enabled in your user preferences automatically if you open a codespace in the web client and turn on Settings Sync in the codespace.

When Settings Sync is enabled in your user preferences, for codespaces opened in the web client, the behavior of Settings Sync depends on your list of trusted repositories.

  • If you create a codespace from a repository you trust, Settings Sync is turned on in the codespace by default, so your settings are synced both to and from the cloud.

  • If you create a codespace from a repository you haven't added to your list of trusted repositories, the sync takes place in one direction and at one time only. When you create the codespace, your settings are pulled into the codespace from your cached settings in the cloud, but from then on, Settings Sync is turned off in the codespace. This means updates you make to your settings in the codespace are not pushed back to the cloud, and any updates you make to your cached settings from elsewhere are not reflected in the codespace after you have created it.

    If you turn on Settings Sync in a codespace, you will be prompted to add the repository to your list of trusted repositories. For more information, see "Turning on Settings Sync in a codespace."

Deine Liste vertrauenswürdiger Repositorys für GitHub Codespaces wird von den GpG-Überprüfungs- und Einstellungssynchronisierungsfeatures gemeinsam genutzt. Wenn du beide Features aktiviert hast und eine ausgewählte Liste vertrauenswürdiger Repositorys für die GPG-Überprüfung hinzugefügt hast, wird die Einstellungssynchronisierung in Codespaces aktiviert, die in diesen Repositorys erstellt wurden. Wenn du einem neuen Repository für die Einstellungssynchronisierung vertraust, ist die GPG-Überprüfung für dasselbe Repository aktiviert. Obwohl die Features dieselbe Liste vertrauenswürdiger Repositorys verwenden, kannst du GPG-Überprüfung und Einstellungssynchronisierung unabhängig voneinander aktivieren oder deaktivieren.

Hinweis: Wenn du die GPG-Überprüfung zuvor für alle Repositorys aktiviert hast, solltest du deine Einstellungen so ändern, dass eine ausgewählte Liste vertrauenswürdiger Repositorys verwendet wird. Weitere Informationen findest du unter Sicherheit in GitHub Codespaces.

For more information on managing your preferences for GPG verification, see "Verwalten der GPG-Überprüfung für GitHub Codespaces."

Managing your preferences for Settings Sync

If you enable Settings Sync in your user preferences, codespaces opened in the VS Code web client will pull in your cached settings from the cloud, and codespaces created from trusted repositories will sync with your cached settings in both directions.

  1. Klicke auf einer beliebigen Seite in der oberen rechten Ecke auf dein Profilfoto und anschließend auf Einstellungen.

    Screenshot of a user's account menu on GitHub. The menu item "Settings" is outlined in dark orange.

  2. Klicke im Abschnitt „Code, Planung und Automatisierung“ der Seitenleiste auf Codespaces.

  3. To enable or disable Settings Sync, under "Settings Sync," select or deselect Enable.

  4. Um deine vertrauenswürdigen Repositorys für GPG-Überprüfung und Einstellungssynchronisierung zu ändern, wähle unter „Vertrauenswürdige Repositorys“ entweder Alle Repositorys aus, oder wähle Ausgewählte Repositorys aus, und verwende die Dropdownliste „Repositorys auswählen“, um Repositorys hinzuzufügen, denen du vertraust.

    Hinweis: Du solltest eine ausgewählte Liste vertrauenswürdiger Repositorys verwenden. Weitere Informationen findest du unter Sicherheit in GitHub Codespaces.

Your updates will take effect in new codespaces. However, you can turn on Settings Sync in an existing codespace. For more information, see "Turning on Settings Sync in a codespace."

Turning on Settings Sync in a codespace

Note: You should only turn on Settings Sync in codespaces created from repositories you trust. For more information, see "Sicherheit in GitHub Codespaces."

The following procedure describes how to turn on Settings Sync in a codespace opened in the web client. For information about turning on Settings Sync in the VS Code desktop application, see Settings Sync in the VS Code documentation.

  1. In VS Code, at the bottom of the Activity Bar, select , then click Sign in to Sync Settings.

  2. If the repository from which you created the codespace is not in your list of trusted repositories, a browser window will open asking you to authorize additional permissions for Settings Sync. If you trust the repository, click Authorize, then close the browser window. The codespace will reload and display your latest synced settings.

    Note: If you have Settings Sync disabled in your user preferences, and have set your trusted repositories to all repositories, you will see a warning about enabling Settings Sync for all repositories. Review the warning and choose whether to enable Settings Sync for all repositories or revise your list of trusted repositories.

  3. To configure which settings you want to sync, open the Command Palette with Shift+Command+P (Mac) / Ctrl+Shift+P (Windows/Linux), then start typing "Settings Sync". Click Settings Sync: Configure....

  4. Select the settings you want to sync, then click OK.

    Screenshot of the "Setting Sync" options. There are seven options, each with a checkbox. The "OK" button is shown top right.

Turning off Settings Sync in a codespace

Du kannst die Einstellungssynchronisierung deaktivieren, um das Synchronisieren von Einstellungen in beiden Richtungen mit einer Instanz von VS Code zu beenden.

Wenn du die Einstellungssynchronisierung in einem Codespace deaktivierst, verwenden neue Codespaces weiterhin die Einstellungen, die seit dem letzten Push deiner Einstellungen in die Cloud zwischengespeichert wurden. Wenn du den VS Code-Webclient für Codespaces verwendest und möchtest, dass Codespaces die Standardeinstellungen anstelle deiner zwischengespeicherten Einstellungen verwenden, kannst du die Einstellungssynchronisierung deaktivieren. Weitere Informationen findest du unter Verwalten deiner Einstellungen für die Einstellungssynchronisierung.

Wenn du zur Verwendung der VS Code-Standardeinstellungen in allen Instanzen von VS Code einschließlich der Desktopanwendung zurückkehren möchtest, kannst du den Cache in der Cloud löschen, wenn du die Einstellungssynchronisierung deaktivierst.

  1. Wenn die Einstellungssynchronisierung in deiner Instanz von VS Code derzeit deaktiviert ist, und du deine zwischengespeicherten Einstellungen löschen möchtest, musst du sie zuerst aktivieren. Anweisungen findest du unter Personalizing GitHub Codespaces for your account.

  2. Wähle unten auf der Aktivitätsleiste aus, und klicke auf Einstellungssynchronisierung ist aktiviert.

  3. Klicke in der Dropdownliste auf Einstellungssynchronisierung: Deaktivieren.

    Screenshot des Dropdownmenüs mit hervorgehobener Option „Einstellungssynchronisierung: Deaktivieren“ mit dunkelorangenem Rahmen.

  4. Um die zwischengespeicherten Einstellungen zu löschen, wähle im Dialogfeld Synchronisierung auf allen Geräten deaktivieren und die Daten aus der Cloud löschen aus.

    Screenshot des Dialogfelds: „Möchten Sie die Synchronisierung deaktivieren?“. Die Option zum Löschen von Daten aus der Cloud ist ausgewählt.

  5. Klicke auf Deaktivieren.

Dotfiles

Dotfiles are files and folders on Unix-like systems starting with . that control the configuration of applications and shells on your system. You can store and manage your dotfiles in a repository on GitHub. For advice and tutorials about what to include in your dotfiles repository, see GitHub does dotfiles.

Your dotfiles repository might include your shell aliases and preferences, any tools you want to install, or any other codespace personalization you want to make.

You can configure GitHub Codespaces to use dotfiles from any repository you own by selecting that repository in your personal GitHub Codespaces settings.

When you create a new codespace, GitHub clones your selected dotfiles repository to the codespace environment, and looks for one of the following files to set up the environment.

  • install.sh
  • install
  • bootstrap.sh
  • bootstrap
  • script/bootstrap
  • setup.sh
  • setup
  • script/setup

If none of these files are found, then any files or folders in your selected dotfiles repository starting with . are symlinked to the codespace's ~ or $HOME directory.

Any changes to your selected dotfiles repository will apply only to each new codespace, and do not affect any existing codespace.

Note: Currently, Codespaces does not support personalizing the User-scoped settings for VS Code with your dotfiles repository. You can set default Workspace and Remote [Codespaces] settings for a specific project in the project's repository. For more information, see "Einführung in Entwicklungscontainer."

Enabling your dotfiles repository for Codespaces

You can use your selected dotfiles repository to personalize your GitHub Codespaces environment. Once you choose your dotfiles repository, you can add your scripts, preferences, and configurations to it. You then need to enable your dotfiles from your personal GitHub Codespaces settings page.

Warning: Dotfiles have the ability to run arbitrary scripts, which may contain unexpected or malicious code. Before installing a dotfiles repo, we recommend checking scripts to ensure they don't perform any unexpected actions.

  1. Klicke auf einer beliebigen Seite in der oberen rechten Ecke auf dein Profilfoto und anschließend auf Einstellungen.

    Screenshot of a user's account menu on GitHub. The menu item "Settings" is outlined in dark orange.

  2. Klicke im Abschnitt „Code, Planung und Automatisierung“ der Seitenleiste auf Codespaces.

  3. Under "Dotfiles", select Automatically install dotfiles so that GitHub Codespaces automatically installs your dotfiles into every new codespace you create.

    Screenshot of the "Dotfiles" section of the codespace settings, with the "Automatically install dotfiles" option cleared.

  4. Use the dropdown to choose the repository you want to install dotfiles from.

    Screenshot of the "Automatically install dotfiles" option selected and "monalisa/dotfiles" selected from a dropdown list of repositories.

You can add further script, preferences, configuration files to your dotfiles repository or edit existing files whenever you want. Changes to settings will only be picked up by new codespaces.

If your codespace fails to pick up configuration settings from dotfiles, see "Problembehandlung bei Personalisierungsoptionen für GitHub Codespaces."

Other available settings

You can also personalize GitHub Codespaces using additional options in your personal settings:

Further reading