1

その構成でPythonスクリプトを呼び出すJenkinsジョブがあります。スクリプトはいくつかのファイルを作成して実行git add path/to/new/filesし、git commit -m "foobar"次にgit push -u origin my_branch。そのスクリプトをローカルで呼び出すと、必要なファイルが追加され、そのブランチにプッシュされます。Jenkinsジョブがそのスクリプトを呼び出すとgit push、エラーが返されます。

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

それはなぜですか?git pull後でファイルを作成できるようにする必要があります。

4

1 に答える 1

0

特定の URL を Git に伝えることが役に立ちました。

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

于 2012-09-13T08:23:05.037 に答える