I am in the process of setting up notebook instances for several users in a team. These users will be able to use version control. The issue is that when a user commits the Author of the commit is ec2-default-user. I want the author to be "username" eg john doe.
I know that one solution to this is to tell the users to write in the command line "git config --global user.name "John Doe"".
This does not work for me as I want this to be automated for the users. Therefore I am looking for a way to extract the user's username in the lifecycle config and then pass this username to some code which will set the author of any commits to the user's username.
This is what I have currently
set -e
cat << EOF >> /home/ec2-user/.gitconfig
[user]
name = John Doe
EOF
but where there is John Doe I would like it to be the username of the current user who has opened up their sagemaker notebook instance.
I would like a way to extract the username in the lifecycle config and pas this value to the code that sets the username. I'm relatively new to all this hence the limited knowledge. I've looked on documentation but can't seem to find much.