LinuxCommandLibrary

git-touch

Create files and stage them for commit

TLDR

Touch and stage file

$ git touch [file.txt]
copy
Create multiple files
$ git touch [file1.txt] [file2.txt]
copy

SYNOPSIS

git touch files

DESCRIPTION

git touch creates files and stages them for commit. It combines the Unix `touch` command with `git add`, creating empty files that are immediately tracked.
The command is useful for creating placeholder files that will be committed. It saves the separate steps of creating files then adding them.

PARAMETERS

FILES

Files to create and stage.
--help
Display help information.

CAVEATS

Part of git-extras package. Creates empty files. Files still need to be committed.

HISTORY

git touch is part of git-extras, combining file creation with staging for convenience.

SEE ALSO

touch(1), git-add(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community