我收到这条消息:
Cannot pull with rebase: You have unstaged changes.
Please commit or stash them.
是的,我有一些未提交的更改。我搜索了一种方法,在从拉取中获得的新代码之上重新调整未提交的更改。
我找到了这个:https://github.com/aanand/git-up https://github.com/aanand/git-up
我想知道这是否仍然是可行的方法,或者是否有更现代的方法可以采用。
我使用git版本1.8.1
git-up https://github.com/aanand/git-up可能是解决这个问题的更复杂的方法。
否则,您需要 stash、rebase 和 stash pop。
“更现代的方式”将在 git 1.8.5(或 1.9,2013 年第四季度)中提供。
正如我在“Git - 如何使用当前索引(当前状态)中的一些未暂存的更改来编辑旧的(不是以前的)提交? https://stackoverflow.com/a/17284754/6309":
"git rebase
“ 学到了 ”--[no-]autostash
" option保存本地更改而不是拒绝运行(人们的正常反应是隐藏它们并重新运行)。
自 Git 2.9(2016 年 6 月)起 https://stackoverflow.com/a/30209750/6309,你现在已经(正如评论者战争艺术 https://stackoverflow.com/users/901641/artofwarfare):
git pull --rebase --autostash
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)