LinuxCommandLibrary

git-setup

Initialize a repo and commit all existing files

TLDR

Create a new repo in the current directory with an initial commit
$ git setup
copy
Setup a repo in a specific directory
$ git setup [path/to/directory]
copy

SYNOPSIS

git setup [directory]

DESCRIPTION

git setup initializes a new Git repository and makes an initial commit with all existing files. Part of the git-extras package, it combines `git init`, `git add .`, and `git commit -m "Initial commit"` into a single command.
This is useful for quickly turning an existing directory of files into a Git repository with a clean starting snapshot.

PARAMETERS

DIRECTORY

Directory to set up (default: current directory).

CAVEATS

Part of the git-extras package and must be installed separately. Commits all files immediately, so ensure a .gitignore file is in place first to avoid tracking unwanted files.

HISTORY

git setup is part of git-extras, a collection of useful Git utilities created by TJ Holowaychuk. It combines common initialization steps for new repositories.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard