相关疑难解决方法(0)

自动存储git rebase上的保存/弹出更改?

我的git工作流程经常使用rebase.我总是取上游的变化(主要回购我从分叉),然后合并到我的树枝,然后重订去除无用的(对我说:d)合并的提交和树分裂.

这个工作流程中的一件事让我烦恼的是:

$ git rebase upstream/master
Cannot rebase: You have unstaged changes.
Please commit or stash them.

$ git stash
Saved working directory and index state WIP on cc: abc1234 Merge remote-tracking branch 'upstream/master' into local_branch
HEAD is now at abc1234 Merge remote-tracking branch 'upstream/master' into local_branch

$ git rebase upstream/master
First, rewinding head to replay your work on top of it...
Applying: awesome code change

$ git stash pop
Run Code Online (Sandbox Code Playgroud)

所以这里我们有4个命令,1 =失败的rebase,2 = stash,3 = rebase,4 = stash pop.除了3之外的任何东西都是无意识的工作

所以,问题是:最推荐的自动化方法是什么?每次都运行git …

git git-stash

35
推荐指数
3
解决办法
1万
查看次数

如何让 Git 不列出修改过的更改?

Git status 会给我已更改的文件列表,其中我有一些已更改但我不想提交,只需将其保留在工作目录中即可。令人烦恼的是,在提交之前,如果有新的更改,我必须扫描这些文件的差异,或者这些修改只是我知道的并且不想提交的修改。

有没有办法告诉 Git 这些修改不要提交,但让我知道是否有任何其他更改?虽然恐怕不存在需要另一种索引来放置这些“不想暂存此更改”版本文件的情况,但如果有类似的情况,请告诉我。

git

1
推荐指数
1
解决办法
184
查看次数

标签 统计

git ×2

git-stash ×1