我怎样才能只应用一些git stash? [英] How can I apply only some of a git stash?

查看:62
本文介绍了我怎样才能只应用一些git stash?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将git stash中的某些更改应用于一次提交,其余的更改应用于另一提交.

I want to apply some of the changes in a git stash to one commit, and the rest of the changes to another.

推荐答案

取消隐藏...

git stash pop

...在补丁模式下使用git add ...

...use git add in patch mode...

git add -p

...然后提交...

...and then commit that...

git commit -m "Partial stashed commit"

这是我不阅读文档而很快想到的. 狮子座的答案有更好的方法来实现这一目标.

This is what quickly came to my head without reading the docs. Leo's answer has much better way to achieve this.

这篇关于我怎样才能只应用一些git stash?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆