text GIT Cherrypick&删除现有标签并再次推送更改

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text GIT Cherrypick&删除现有标签并再次推送更改相关的知识,希望对你有一定的参考价值。

Thanks to nickfloyd [https://gist.github.com/nickfloyd/739288] & danielestevez [https://gist.github.com/danielestevez/2044589]
This GIST is completely their. 
Thanks to them. :)

To cherry pick from head and commit back into a tag
============================================================================================================
-from master in working branch
>> git branch [new branch] [tag]
>> git checkout [branch]
-pull commit out and add it to the commit at the top of the tag
>> git cherry-pick [commit] or git cherry-pick [firstcommit]^..[lastcommit] if you have a range
-resolve conflicts
-delete the local tag
>> git git tag -d [tag]
-add a new tag at the head of the old one
>> git tag [tag]
-delete the remote tag
>> git push origin :[tag]
-push new tag and commits
>> git push origin [tag]

ex.
git branch a release_a
git checkout a
git cherry-pick 899a25202dbf8bdb58fc73ae836f50660ec0b23b
git tag -d release_a
git tag release_a
git push origin :release_a
git push origin release_a

----------------------------------------------------------------------------------

GIT Commit to an existing Tag
==========================================
1) Create a branch with the tag
	git branch {tagname}-branch {tagname}
	git checkout {tagname}-branch

2) Include the fix manually if it's just a change .... 
	git add .
	git ci -m "Fix included"
    or cherry-pick the commit, whatever is easier
	git cherry-pick  {num_commit}
	
3) Delete and recreate the tag locally
	git tag -d {tagname}
	git tag {tagname}

4) Delete and recreate the tag remotely
	git push origin :{tagname} // deletes original remote tag
	git push origin {tagname} // creates new remote tag

以上是关于text GIT Cherrypick&删除现有标签并再次推送更改的主要内容,如果未能解决你的问题,请参考以下文章

git篇之Cherry-pick

Git cherry-pick极速理解

Git 场景 :从一个分支cherry-pick多个commit

sql 选择Multiple~CherryPick~

text git&composer忽略文件模式的变化

git --- cherry-pick用法