2013-12-09 97 views
4

我創建了一個輪詢Git源代碼的工作。jenkins git插件每次都克隆

第一次應該克隆倉庫,之後如果倉庫存在,那麼它應該只有pull它。

請參閱以下作業設置。

enter image description here

問題:每次當我運行這個作業時它總是克隆的它而不是投票吧。

我正在檢查快速遠程輪詢,它說倉庫應該只有一個分支。所以爲此我指定了分支名稱。

我在這裏錯過了什麼..?

+0

嗯,我認爲這是默認的行爲。注意'polling'=/='拉'':-) – mhutter

+0

@Dratir默認行爲是指?它會一直克隆嗎?假設我的git Repo大小爲10GB或更大,並且我想在30分鐘內每運行一次我的工作,那麼克隆需要花費更多的時間。我不知道它的默認行爲。 –

回答

2

確保在從Git有最新版本: 瞭解更多詳情請看下圖:

enter image description here

+0

我沒有看到你的答案(我在幾個月前寫過)。 +1 – VonC

1

有一個similar bug for Mercurial指出一個憑證問題。
因此請仔細檢查您的憑據傳遞的方式(通過URL或存儲在文件中,就像一個.netrc爲hhtps)

的一點是:快速投票應取/拉而不是克隆。請參閱hudson.plugins.git.GitSCM#compareRemoteRevisionWithImpl()

  if (git.hasGitRepo()) { 
       // Repo is there - do a fetch 
       listener.getLogger().println("Fetching changes from the remote Git repositories"); 

       // Fetch updates 
       for (RemoteConfig remoteRepository : paramRepos) { 
        fetchFrom(git, listener, remoteRepository); 
       } 

       listener.getLogger().println("Polling for changes in"); 
+0

注意:更改工作是「使用工作區強制輪詢」:https://github.com/jenkinsci/git-plugin/pull/181。這將對「快速輪詢」功能產生影響。 – VonC