假设我有一个功能分支,我在推送我的更改之前将上游更改合并到该分支中:
git branch feature1
... [edit my code]
... [commit]
git fetch origin master
git merge fetch_head [or rebase]
... [resolve conflicts]
... [build and test code]
现在我想要推送我的更改。通常的做法是:
git checkout master [changes a bunch of working tree files]
git merge feature1 [changes the same files right back]
这段代码很好用,但编译器会认为很多文件需要重新构建,即使内容没有变化。有没有一种检出和合并的方法,在这种情况下不更改工作树呢?
类似于:
git checkout master --merge-branch feature1
编辑:
我只是在谈论快速向前合并,根据定义,这种合并不会改变文件的状态。