Skip to content

new_feature.untracked

new_feature.untracked

Copy local work between checkouts without committing or overwriting it.

local_paths(worktree: Path, excludes: list[str]) -> tuple[Path, ...]

Find transferable local files with Git's native ignore-pattern matching.

same_local_file(source: Path, destination: Path) -> bool

Compare regular-file contents and permission bits, rejecting symlinks.

validate_local_paths(root: Path, worktree: Path, paths: tuple[Path, ...], tracked: set[Path]) -> None

Refuse unsafe sources, destination aliases, tracked paths, or different files.

copy_local_files(root: Path, worktree: Path, paths: tuple[Path, ...], tracked: set[Path]) -> None

Copy without replacing existing files; retain all originals on success or failure.

require_local_files_preserved(root: Path, worktree: Path, excludes: list[str]) -> None

Protect local work unless an identical regular file exists outside the worktree.