← 返回命令列表

Linux command

git-merge-into 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Merge current branch into target

git merge-into [target-branch]

Merge current branch into main

git merge-into main

Merge the specified source into the target

git merge-into [source-branch] [target-branch]

说明

git merge-into merges the current (or specified) branch into another branch without manually switching contexts. It reverses the normal merge workflow, where one would first checkout the target branch, perform the merge, then switch back. The command checks out the target, performs the merge, then returns to the original branch automatically. This saves the repetitive workflow of switching branches for a simple merge operation.

参数

--ff-only
Refuse the merge unless it can be resolved as a fast-forward.
--help
Display help information.

FAQ

What is the git-merge-into command used for?

git merge-into merges the current (or specified) branch into another branch without manually switching contexts. It reverses the normal merge workflow, where one would first checkout the target branch, perform the merge, then switch back. The command checks out the target, performs the merge, then returns to the original branch automatically. This saves the repetitive workflow of switching branches for a simple merge operation.

How do I run a basic git-merge-into example?

Run `git merge-into [target-branch]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --ff-only do in git-merge-into?

Refuse the merge unless it can be resolved as a fast-forward.