git-touch

Create files and stage them for commit

TLDR

Touch and stage file
$ git touch [file.txt]
Create multiple files
$ git touch [file1.txt] [file2.txt]

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.

INSTALL

sudo apt install git
sudo dnf install git
sudo pacman -S git
sudo apk add git
sudo zypper install git
brew install git
nix profile install nixpkgs#git

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), git-extras(1)

RESOURCES

Source code · Documentation