#Thread
1 messages · Page 1 of 1 (latest)
I see my own user. Assuming we use git config --list info
Though I don't see git info with
container-use config show
Base Image: ubuntu:24.04
Workdir: /workdir
Setup Commands: (none)
Install Commands: (none)
Environment Variables: (none)
Secrets: (none)
I do see mention of setting these in an environment.json
https://github.com/dagger/container-use/blob/main/.container-use/environment.json#L8-L9
https://container-use.com/environment-configuration#configuration-storage
Your default environment configuration is stored in .container-use/environment.json in your project root.
cc @lavish rapids, maybe you know off the top of your head where we grab git info from by default
@wind knoll could you share what user you're seeing instead? Might help unravel the mystery.
We don’t grab git info from anywhere, we just call your git cli without any additional configuration and it loads its own
but you could set your git config for the cu session via the environment.json approach above, eh? Or would that be global settings you'd have to unwind later.
No, you can’t— cu uses git on the host machine, not inside environments
right, so that example would mutate your git global settings? 👇
https://github.com/dagger/container-use/blob/main/.container-use/environment.json#L8-L9
No, that example mutates the environments git
ah, cool. Totally separate things.
Was just surprised that the user was seeing commits from cu from a different user.
@wind knoll do you do anything “special” with user space file organization or git on this machine? Like having your home directory as a repo? Does your ~/.gitconfig have your desired user in it?
or maybe your ~/.config directory is a git repository (with it's own config)
@wind knoll likely you don't have a global git config set up.
If you run
git config --list --global
vs
git config --list
do you see different results for these?
user.email
user.name
Actually
git config --list --show-origin
will show where all of the settings come from.
Maybe the repo you're working on has a .env file or something that sets this
Also, it seems that if you set user.name or user.email multiple times, the last instance will win. So in my case I did a
git config user.name "Temp User"
on top of my exisiting config, resulting in two entries.
git config --list --show-origin | grep user.name
file:/Users/jeremyadams/.gitconfig user.name=Jeremy Adams
file:.git/config user.name=Temp User
But only one wins:
git config user.name
Temp User
Oh Wow, I'm a bit embarassed, but you nailed it! I do have different .gitconfig files for the different directories on my laptop where I have my projects and usually one of them would win. But the container is not run from one of these directories and so it uses the global config, that actually has the Temp User. Ups 🫢 Anyway, thanks so much for helping out!
@wind knoll you mind opening a GitHub issue now that we understand what’s going on here? We should probably actually be respecting/copying repo-specific git config when we “fork” for container-use.
Sure, I'll do that!
@wind knoll I was experiencing the same issue! Thanks for bringing this up - would you mind sharing the link to the issue?