git Verified current stable Not installed? Version Control

Git / Create Git Repo Current Directory Commit All Files

Create Git Repo Current Directory Commit All Files

Quickly set up a Git repository in the current directory and commit all files for version control.

$
Terminal
git setup

When To Use

Setting up version control for a new project in the current directory.

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
Initialized empty Git repository in /path/to/current/directory/.  
[master (root-commit) 1234567] Initial commit  
 1 file changed, 0 insertions(+), 0 deletions(-)  
create mode 100644 README.md

Command Breakdown

What each part is doing

git
Base Command
The executable that performs this operation. Here it runs Git before the shell applies any redirect operators.

How To Run

Execution path

  1. Step 1

    Run `git init` to initialize a new Git repository.

  2. Step 2

    Add all files with `git add .` to stage them for commit.

  3. Step 3

    Commit the changes using `git commit -m "Initial commit"`.

Alternative Approaches

Comparable commands in other tools

Alternative version control tools for the same job.