gre*_*ghz 40 git github git-merge git-commit
有人分叉了我的Github项目并进行了一些更改.如何将更改合并到我的上游版本中?
另外,是否可以仅提取特定提交?
我正在寻找的是,是否有办法提取特定的提交而不是整个分支.
Dus*_*tin 47
拉入单个提交将是一个挑选,并将重写提交ID(并在保留作者时将您标记为提交者).不过,这个过程非常简单:
git fetch git://github.com/user/project.git
git cherry-pick <SHA-COMMIT-ID>
您从存储库日志中获取SHA,例如:
git log --oneline
b019cc0 Check whether we have <linux/compiler.h>.
0920898 Include <linux/compiler.h> before including <linux/usbdevice_fs.h>.
cbf0ba1 Add DLT_DBUS, for raw D-Bus messages.
77ed5cd Libnl 2.x returns its own error codes, not errnos; handle that.
随着git cherry-pick 0920898您将相应的提交带到您当前的分支.