When you run git commit with no arguments, it will open your default editor to allow you to type a commit message. Saving the file and quitting the editor will make the commit.

It looks like your default editor is Vi or Vim. The reason "weird stuff" happens when you type is that Vi doesn't start in insert mode - you have to hit i on your keyboard first! If you don't want that, you can change it to something simpler, for example:

git config --global core.editor nano

Then you'll load the Nano editor (assuming it's installed!) when you commit, which is much more intuitive for users who've not used a modal editor such as Vi.

That text you see on your screen is just to remind you what you're about to commit. The lines are preceded by # which means they're comments, i.e. Git ignores those lines when you save your commit message. You don't need to type a message per file - just enter some text at the top of the editor's buffer.

To bypass the editor, you can provide a commit message as an argument, e.g.

git commit -m "Added foo to the bar"
Answer from Ben James on Stack Overflow
🌐
Git
git-scm.com › docs › git-commit
Git - git-commit Documentation
Make a commit by taking the updated working tree contents of the paths specified on the command line, disregarding any contents that have been staged for other paths. This is the default mode of operation of git commit if any paths are given on the command line, in which case this option can be omitted.
🌐
W3Schools
w3schools.com › git › git_commit.asp
Git Commit
You can always go back to a previous commit if you need to. ... git commit -m "First release of Hello World!" [master (root-commit) 221ec6e] First release of Hello World!
🌐
Atlassian
atlassian.com › git › tutorials › saving-changes › git-commit
Git Commit | Atlassian Git Tutorial
Commit a snapshot of all changes in the working directory. This only includes modifications to tracked files (those that have been added with git add at some point in their history). ... A shortcut command that immediately creates a commit with a passed commit message.
🌐
Git Tower
git-tower.com › learn › git › commands › git-commit
git commit - Saving changes to the local repository | Learn Version Control with Git
The "commit" command is used to save your changes to the local repository. Note that you have to explicitly tell Git which changes you want to include in a commit before running the "git commit" command.
🌐
GitHub
github.com › git-guides › git-commit
Git Guides - git commit · GitHub
You can also use a handy command, git add -p, to walk through the changes and separate them, even if they're in the same file. git commit: This starts the commit process, but since it doesn't include a -m flag for the message, your default text ...
🌐
GitKraken
gitkraken.com › home › learn › learn git: commit
Git Commit - How to Git Commit | Learn Git
March 24, 2021 - In this example, after the git ... In order to commit these changes in the CLI, you will need to stage the changes with the git add command, followed by the name of the file....
🌐
GitLab
docs.gitlab.com › tutorials › make_first_git_commit
Tutorial: Make your first Git commit | GitLab Docs
... On branch example-tutorial-branch Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: README.md no changes added to commit (use "git add" and/or "git commit -a")
Find elsewhere
🌐
BitDegree
bitdegree.org › learn › git-commit-command
Learn How to Commit to Git: Git Commit Command Explained
January 30, 2018 - The Git add command moves changes to the staging area. ... Git moves all changes of <file> in the staging area to wait for the next commit.
🌐
GeeksforGeeks
geeksforgeeks.org › git › committing-in-git
Committing in Git - GeeksforGeeks
3 weeks ago - To commit changes for a particular file, specify the file path along with the commit command. git commit /path_of_the_file -m "commit_message here"
🌐
DataCamp
datacamp.com › tutorial › git-commit
Git Commit Tutorial: How to Track and Document Code Changes | DataCamp
March 25, 2025 - One of the most fundamental building blocks of version control in Git is the git commit command. A git commit captures a snapshot of the current state of your staged files and saves them to the repository’s history.
🌐
Microsoft Learn
learn.microsoft.com › en-us › visualstudio › version-control › git-make-commit
Make a Git commit in Visual Studio | Microsoft Learn
2 weeks ago - Just enter your commit message and then select Commit All. The equivalent command for this action is git commit -a.
🌐
freeCodeCamp
freecodecamp.org › news › git-commit-command-explained
Git Commit Command Explained
December 29, 2019 - The git commit command will save all staged changes, along with a brief description from the user, in a “commit” to the local repository. Commits are at the heart of Git usage.
🌐
Reddit
reddit.com › r/git › trying to commit using command line / terminal
r/git on Reddit: Trying to commit using command line / terminal
July 21, 2024 -

Hi all,

I'm trying to commit to GitHub, having previously pushed and I'm getting this screen. Such a basic question but what do i do here? I've tried using the commands at the bottom, e.g. Exit.

🌐
Career Karma
careerkarma.com › blog › git › git commit
Git Commit: an important part of the Git version control system.
December 1, 2023 - The git commit command is one step in “saving” the changes made to a project to a repository. The git add command line function is first used to create a record of the changes that will be stored in a commit, then git commit is used to create ...
🌐
Linux Kernel
kernel.org › pub › software › scm › git › docs › git-commit.html
git-commit(1) Manual Page
November 24, 2025 - For example, git commit --amend --no-edit amends a commit without changing its commit message. ... Replace the tip of the current branch by creating a new commit. The recorded tree is prepared as usual (including the effect of the -i and -o options and explicit pathspec), and the message from ...
🌐
CloudBees
cloudbees.com › blog › git-commit-detailed-tutorial-on-saving-your-code
Git Commit: A Detailed Tutorial on Saving Your Code
When working with Git, you’re more likely to commit changes to existing files than to create new ones. To do that, you use git add—it’s a multipurpose command—to stage the changes you want to commit—that is, to include them in the next commit.
🌐
GeeksforGeeks
geeksforgeeks.org › git › what-is-git-commit
Git Commit - GeeksforGeeks
February 27, 2026 - Ways to Use the git commit Command explains the different methods and options available for creating commits in Git.
🌐
Graphite
graphite.com › guides › how-to-use-git-commit-m-command
How to use the git commit -m command - Graphite
This command is particularly useful when you have made changes to existing files and want to quickly commit those changes without individually staging each one. The git commit -m command helps you cleanly organize and manage changes to your projects.
🌐
Intellipaat
intellipaat.com › home › blog › git commit explained: what it does, how to use it, and tips
Git Commit Command Explained: Usage, Examples, and Tips
October 31, 2025 - Learn how the git commit command works, step-by-step examples, key options like -m and --amend, and tips for clean commit history. Includes tips for beginners and pros.