gpt4 book ai didi

git - Git 交互式 rebase 中的 "pick"有什么作用?

转载 作者:行者123 更新时间:2023-12-03 20:21:36 24 4
gpt4 key购买 nike

当我执行 git rebase --interactive 时,我有六个基本命令: pickrewordeditsquashfixupexec
pick 命令有什么作用?它是 cherry-pick 提交还是 checkout 它?

最佳答案

help article :

pick
pick simply means that the commit is included. Rearranging the order of the pick commands changes the order of the commits when the rebase is underway. If you choose not to include a commit, you should delete the entire line.



为了完整起见,这里还有其他命令:

reword
The reword command is similar to pick, but after you use it, the rebase process will pause and give you a chance to alter the commit message. Any changes made by the commit are not affected.
edit
If you choose to edit a commit, you'll be given the chance to amend the commit, meaning that you can add or change the commit entirely. You can also make more commits before you continue the rebase. This allows you to split a large commit into smaller ones, or, remove erroneous changes made in a commit.
squash
This command lets you combine two or more commits into a single commit. A commit is squashed into the commit above it. Git gives you the chance to write a new commit message describing both changes.
fixup
This is similar to squash, but the commit to be merged has its message discarded. The commit is simply merged into the commit above it, and the earlier commit's message is used to describe both changes.
exec
This lets you run arbitrary shell commands against a commit.

关于git - Git 交互式 rebase 中的 "pick"有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45563865/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com