Mount Git configuration
Mount your Git configuration into workspaces to set your Git identity and preferences.
|
The |
Prerequisites
-
You have an active
kubectlsession with your namespace. See Overview of kubectl.
Procedure
-
Create a ConfigMap with your Git configuration:
kind: ConfigMap apiVersion: v1 metadata: name: workspace-userdata-gitconfig-configmap labels: controller.devfile.io/mount-to-devworkspace: 'true' controller.devfile.io/watch-configmap: 'true' annotations: controller.devfile.io/mount-as: subpath controller.devfile.io/mount-path: /home/user data: .gitconfig: | [user] name = Your Name email = your.email@example.com [core] editor = vim [pull] rebase = true -
Apply the ConfigMap to your namespace:
$ kubectl apply -f gitconfig.yaml -n <your_namespace> -
Start or restart your workspace.
Verification
-
Open a terminal in your workspace.
-
Verify the Git configuration:
$ git config --list
Additional resources