2016-02-29 43 views
2

我們是2人試圖在bitbucket上使用git。開發人員正在使用簡單的標籤來跟蹤所有提交 - 而QA人員正試圖根據標籤提取新代碼。使用Git標籤 - 不能拉新標籤

所以dev的決定

git commit -v -am "($date) $comments" 
git tag -a version-1 -m "($date) $comments" 
git push --tags 

的QA傢伙確實

git clone <path> ; cd $dir 
    git checkout tags/version-1 

這確實需要的首次周圍 - 但第二次 - 用於更新標籤 - 它給錯誤消息。

第一時間爲QA

  • 退房是成功的消息

    注:檢查出 '標籤/版本-1'。

    You are in 'detached HEAD' state. You can look around, make experimental 
    changes and commit them, and you can discard any commits you make in this 
    state without impacting any branches by performing another checkout. 
    
    If you want to create a new branch to retain commits you create, you may 
    do so (now or later) by using -b with the checkout command again. Example: 
    
        git checkout -b <new-branch-name> 
    
    HEAD is now at 0c3514c... (02-28-2016) test comments 
    

然後dev的傢伙做了他的變化,然後做

git commit -v -am "($date) $comments" 
git tag -a version-2 -m "($date) $comments" 
git push --tags 

它經歷了 - 我們可以看到回購新的標籤 - 與變化。

的QA人做他的變化

git checkout tags/version-2 

錯誤消息

error: pathspec 'tags/version-2' did not match any file(s) known to git. 

如果QA確實

git clone <path> ; cd $dir 
    git checkout tags/version-2 

它工作正常! QA人員如何使用開發人員簽入的新標籤更新相同的git導演?

回答

0

使用git fetch從遠程倉庫獲取新標籤。