Git commands

Hello again,

I want a possibility to run git commands from muy build scripts that executed on TeamCity server. (For example: git push)

I've read this doc (http://confluence.jetbrains.com/display/TCD8/VCS+Checkout+Mode). It seems that I need checkout mode Automatically on agent, but how can I activate and use it?

Thanks!

0
5 comments

Hi,

Yes, you need to use "Automatically on agent mode". You can select it in Build Configuration Settings -> Version Control Settings in "Checkout Options" section.

0
Avatar
Permanently deleted user

Yes, it works, thanks.

But I've got the next error:

*** Please tell me who you are.
[07:55:28][Step 1/1]
[07:55:28][Step 1/1] Run
[07:55:28][Step 1/1]
[07:55:28][Step 1/1] git config --global user.email "you@example.com"
[07:55:28][Step 1/1] git config --global user.name "Your Name"





I have the VCS root configuration:
Authentication method: Password
Username: my user name on GitHub
Password: my passoword on GitHub

But it still doesn't work..
What setting fields should I fill else? And where can I be mistaken?

Thanks!
0

Please check that you configured your repository correctly. For example execute "git config --list" in build working directory.

0
Avatar
Permanently deleted user

I've executed
"git config --list" and got the next log:

[02:58:50][Step 1/1] core.symlinks=false
[02:58:50][Step 1/1] core.autocrlf=true
[02:58:50][Step 1/1] color.diff=auto
[02:58:50][Step 1/1] color.status=auto
[02:58:50][Step 1/1] color.branch=auto
[02:58:50][Step 1/1] color.interactive=true
[02:58:50][Step 1/1] pack.packsizelimit=2g
[02:58:50][Step 1/1] help.format=html
[02:58:50][Step 1/1] http.sslcainfo=/bin/curl-ca-bundle.crt
[02:58:50][Step 1/1] sendemail.smtpserver=/bin/msmtp.exe
[02:58:50][Step 1/1] diff.astextplain.textconv=astextplain
[02:58:50][Step 1/1] rebase.autosquash=true
[02:58:50][Step 1/1] core.repositoryformatversion=0
[02:58:50][Step 1/1] core.filemode=false
[02:58:50][Step 1/1] core.bare=false
[02:58:50][Step 1/1] core.logallrefupdates=true
[02:58:50][Step 1/1] core.symlinks=false
[02:58:50][Step 1/1] core.ignorecase=true
[02:58:50][Step 1/1] core.hidedotfiles=dotGitOnly
[02:58:50][Step 1/1] remote.origin.url=https://YcGeneralUser@github.com/YaccConstructor/YC.Utils.SourceText.git
[02:58:50][Step 1/1] remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
[02:58:50][Step 1/1] branch.dev.remote=origin
[02:58:50][Step 1/1] branch.dev.merge=refs/heads/dev
[02:58:50][Step 1/1] submodule.tools/Build.Tools.url=https://YcGeneralUser@github.com/YaccConstructor/Build.Tools.git

So, there are no configs with username and useremail.

After that I tried to execute commands: "git config --global user.email "yc.teamcity@gmail.com" and got the next error:


[02:58:50][Step 1/1] Error:
[02:58:50][Step 1/1] System.Exception: error: could not lock config file (null)/(null)/.gitconfig: No such file or directory

It's strange as "git config --list" is working.

Could your possibly suggest what is the error?
Thanks a lot.
0

Does this command work is run them via console on the same machine as the TeamCity agent and under the same user that the agent is running, with the same environment variables and the same working directory? (steps are described here)

0

Please sign in to leave a comment.