Skip to main content
Worktree commands help you manage files in your working directory and prepare changes for commits. These commands are essential for day-to-day Git operations.

git-add

Add file contents to the index

git-mv

Move or rename a file, a directory, or a symlink

git-restore

Restore working tree files

git-rm

Remove files from the working tree and from the index

Overview

These commands operate on files in your working directory:
  • git-add stages changes for the next commit
  • git-mv moves or renames files while maintaining history
  • git-restore discards or restores changes in working files
  • git-rm removes files from both working tree and index