我怎样才能重命名一个git存储? [英] How can I rename a git stash?
本文介绍了我怎样才能重命名一个git存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我藏了一个不正确的名字。我想修正这个名字,所以它是准确的。
如何重新命名存储空间?
$ git存储列表
存储@ {0} :在主人的WIP上:添加一些非常重要的功能
stash @ {1}:在主人的WIP上:修正一些愚蠢的错误
首先,您必须移除您要重命名的存储条目:
$ git stash drop stash @ {1}
丢弃存储@ {1}(af8fdeee49a03d1b4609f294635e7f0d622e03db)
现在只需再次添加使用删除后返回的提交sha的新消息:
$ git stash store -m非常具有描述性的消息af8fdeee49a03d1b4609f294635e7f0d622e03db
就是这样:
$ git存储列表
存储@ {0}:非常具有描述性的消息
存储@ {1}:主控制器上的WIP:添加一些非常重要的功能
此解决方案需要git 1.8.4或更高版本,是的,它也适用于脏工作目录。
I have a stash with an incorrect name. I would like to fix the name so it's accurate.
How can I rename a stash?
解决方案
Let's assume your stash list looks like this:
$ git stash list
stash@{0}: WIP on master: Add some very important feature
stash@{1}: WIP on master: Fix some silly bug
First, you must remove stash entry which you want to rename:
$ git stash drop stash@{1}
Dropped stash@{1} (af8fdeee49a03d1b4609f294635e7f0d622e03db)
Now just add it again with new message using sha of commit returned after dropping:
$ git stash store -m "Very descriptive message" af8fdeee49a03d1b4609f294635e7f0d622e03db
And that's it:
$ git stash list
stash@{0}: Very descriptive message
stash@{1}: WIP on master: Add some very important feature
This solution requires git 1.8.4 or later, and yes, it works with dirty working directory too.
这篇关于我怎样才能重命名一个git存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文