Reputation: 23
I want to do the following via command line script in teamcity build configuration step:
git rebase master
git push origin <branchname>:<remotebranchname>
In this case, it does not create a specific branch on teamcity agent so not sure, what should be branch name. But just running
git push
throws following exception:
*** 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: unable to auto-detect email address (got 'root@teamcity-xxxxxx(none)')
Host key verification failed. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. Process exited with code 128 Process exited with code 128 (Step: Command Line) Step Command Line failed
Upvotes: 1
Views: 599
Reputation: 23
Git push wasn't working because it needed the sshkey associated with Git. In the above example, I was struggling because I didn't have a way to associate the key for it push command to work.
In teamcity there is a build feature called "SSH Agent" and select the sshkey which you want to associate for push commands. After adding that, the git push command started working.
This feature is available, in build configuration -> Build Feature -> Add Build Feature -> Select "SSH Agent" and select the uploaded key. This is something which is already uploaded in teamcity.
Upvotes: 1