git 的tag和branch 如果重名了 怎么处理
PHP中文网
PHP中文网 2017-05-02 09:41:39
0
2
1267

比如有个tag叫 v1 又有个branch也叫v1 但这俩又指向不同的 commit 那我checkout的时候怎么区分 tag和branch呢

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
为情所困

First of all, be sure not to use tags and branches with the same name. This will put the entire project team into the dilemma of "can you tell whether I am male or female".

"Unified naming standards are important! Unified naming standards are important! Unified naming standards are important!"

I really don’t know how to name it more appropriately. You can refer to Git FLOW

In addition, if there is a duplicate name, there are two ways to rebuild a branch with a meaningful name to solve the problem

git checkout -b new_branch old_branch 
git checkout -b new_branch <sha1>
Peter_Zhu

git checkout tags/v1

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!