I hosted a third_party project on server-1/repo1. This third_party project is added as ExternalProject in repo2 cmake (The real project). The repo2 is our work. Our build environment is docker based. Inside Docker, I am able to clone the repo1 as per configuration of ExternalProject in repo2 cmake. However git pull aka "UpdateCommand" for External Project is failing. It is failing because I don't have git "user.name" and "user.email" set inside docker. As per my thinking, I don't need git "user.name" etc config inside docker for the third_party repo.
The git fetch works inside docker. The git pull is going to add merge commit and probably that's why it need git "user.name" etc. To avoid this, I tried
git pull --no-commit,
but still land into this issue.
Does anybody have insight? The "User Name" for user inside Docker is "User" and There is no email for docker user "User".
Error on git pull:
Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity. Omit --global to set the identity only in this repository.
fatal: empty ident name (for ) not allowed
In order to commit, You must provide your name and email ID just to attach this information to commits for later usage.
You first run these commands:
git config --global user.name "John Doe"
Here John Doe is just for an example. You must provide your name. Then run:
git config --global user.email [email protected]
Here email ID should be your ID. Then try to use your command.
Here --global is optional. However you need to do this only once if you pass the --global option.
If you want to use git as a way of delivering code, and are okay with losing changes (if any) made in the destination repository, then:
if [ -e app ]; then
cd app
git fetch
git reset --hard origin/master
else
git clone GIT_URL app
fi
git pull implies merging/rebasing branches if they diverged. That's why git wants you to specify user.name and user.email.
git reset --hard though tells git to just switch to the specified commit no matter the cost: discarding working tree changes, overwriting unversioned files if they are in the way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With