简体   繁体   中英

How to push to Git branch from Jenkins job?

I have Jenkins job that calls Python script in it's configuration. Script creates few files and executes git add path/to/new/files , git commit -m "foobar" and then git push -u origin my_branch . If I call that script locally, needed files gets added and pushed to that branch. When Jenkins job calls that script, git push returns an error.

error: src refspec my_branch does not match any.
error: failed to push some refs to 'git@example.com:my_project.git'

Any idea why's that? I need to be able to git pull created files afterwards.

告诉Git特定的URL有帮助。

git push -u git@example.com:my_project.git HEAD:my_branch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM