Linux command
git-absorb 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Absorb staged changes
git absorb
Absorb and automatically rebase
git absorb --and-rebase
Dry run
git absorb --dry-run
Specify base commit
git absorb --base [HEAD~5]
Force absorb
git absorb --force
Show verbose output
git absorb --verbose
说明
git-absorb automatically creates fixup! commits for staged changes, matching each hunk to the appropriate commit in your branch history. It is a port of Facebook's hg absorb tool for Mercurial. The workflow is: stage changes with git add, run git absorb to create fixup commits, then either run git rebase -i --autosquash manually or use --and-rebase to do it automatically. By default, absorb searches within the last 10 commits.
参数
- -r, --and-rebase
- Run git rebase --autosquash automatically after creating fixup commits.
- -n, --dry-run
- Show what would be done without making changes.
- -b, --base _commit_
- Use specified commit as base of the absorb stack.
- -f, --force
- Skip safety checks when creating fixup commits.
- -v, --verbose
- Display extra information during execution.
- -w, --whole-file
- Match changes to commits that last touched the file.
- --one-fixup-per-commit
- Only create one fixup per commit; on conflict, use the first hunk.
- --squash-instead-of-fixup
- Create squash commits instead of fixup commits.
- -h, --help
- Print help information.
- -V, --version
- Print version information.
FAQ
What is the git-absorb command used for?
git-absorb automatically creates fixup! commits for staged changes, matching each hunk to the appropriate commit in your branch history. It is a port of Facebook's hg absorb tool for Mercurial. The workflow is: stage changes with git add, run git absorb to create fixup commits, then either run git rebase -i --autosquash manually or use --and-rebase to do it automatically. By default, absorb searches within the last 10 commits.
How do I run a basic git-absorb example?
Run `git absorb` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -r, --and-rebase do in git-absorb?
Run git rebase --autosquash automatically after creating fixup commits.