2016-02-29 41 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从远程仓库获取新标签。