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
The recorded tree is prepared as usual (including the effect of the -i and -o options and explicit pathspec), and the message from the original commit is used as the starting point, instead of an empty message, when no other message is specified from the command line via options such as -m, -F, -c, etc.
🌐
GitHub
github.com › git-guides › git-commit
Git Guides - git commit · GitHub
You may get carried away and end up solving two or three problems before you remember to commit! That's OK – Git can handle that. Once you're ready to craft your commits, you'll use git add <FILENAME> to specify the files that you'd like to "stage" for commit. Without adding any files, the command git commit won't work.
Discussions

How can I commit files with git? - Stack Overflow
No, those lines don't affect what is going to be committed. Those files will still be committed even if you delete the comment lines. They're just a reminder of what the status of your repository was when you ran the git commit command. More on stackoverflow.com
🌐 stackoverflow.com
git - How to commit a change with both "message" and "description" from the command line? - Stack Overflow
I can push commits to GitHub via git (on the command line, not the Mac app). When I push commits directly from the GitHub web interface (e.g. quickly fixing a typo), I have the chance to "comm... More on stackoverflow.com
🌐 stackoverflow.com
Trying to commit using command line / terminal
^ is commonly written to indicate 'CTRL'. You type your commit message (a description of what the changes in this commit represent. For example, 'Documented UI flow for favouriting videos'. You can write multiple lines if you want; the first line is a bit special in the sense that most git tools will show the first 80 characters of the first line in summary reports. Then, you press CTRL + X to quit this editor; it will prompt you if you want to save; say yes (and do not change the file name). git will continue, and fetch the message from what you typed, removing all those lines that start with #. You can omit it with git commit -m 'your message goes here' -m 'line 2 goes here' -m 'add as many lines as you want' but you should get into the habit of writing out proper commit messages, which can be tedious on the command line. You can modify which editor is used with git config - search the web for 'change editor commit message git config' for tutorials. But nano is as good as any if you're just looking for something extremely simple. (that's what's in your screen shot - the nano editor). More on reddit.com
🌐 r/git
5
0
July 21, 2024
Git trailers, what are they for?
Often these are used as simple key-value pairs in automation. For example assigning a Jira ticket to a commit, or a Gitlab ticket. There is a whole bunch of git commands, I'm on my phone so please confirm, where you can filter and search for key-value pairs in trailers. So if you want to search for all commits that have some key set to "true", you can do that. See "git interpret-trailers" for more info. More on reddit.com
🌐 r/git
4
4
May 9, 2023
🌐
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
This command will add hello.py to the Git staging area. We can examine the result of this action by using the git status command. 1git status 2On branch main 3Changes to be committed: 4 (use "git reset HEAD <file>..." to unstage) 5 new file: hello.py
🌐
Git Tower
git-tower.com › learn › git › commands › git-commit
git commit - Saving changes to the local repository | Learn Version Control with Git
Instead, you need to use the "git add" command to mark the desired changes for inclusion. Also note that in Git (not like in Subversion), a commit is not automatically transferred to the remote server. Using the "git commit" command only saves a new commit object in the local Git repository.
🌐
Conventional Commits
conventionalcommits.org › en › v1.0.0
Conventional Commits
types other than fix: and feat: are allowed, for example @commitlint/config-conventional (based on the Angular convention) recommends build:, chore:, ci:, docs:, style:, refactor:, perf:, test:, and others. footers other than BREAKING CHANGE: <description> may be provided and follow a convention similar to git trailer format.
Find elsewhere
🌐
Git
git-scm.com › cheat-sheet
Git Cheat Sheet
git show <commit> git diff <commit> <commit> git diff <commit> <file> git diff <commit> --stat git show <commit> --stat · Every time we say <commit>, you can use any of these: a branch · main · a tag · v0.1 · a commit ID · 3e887ab · a remote branch · origin/main ·
🌐
GitLab
docs.gitlab.com › tutorials › make_first_git_commit
Tutorial: Make your first Git commit | GitLab Docs
Git keeps track of changed files. To confirm which files have changed, get the status. ... 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")
🌐
TheServerSide
theserverside.com › video › Follow-these-git-commit-message-guidelines
Git commit message conventions and best practices | TheServerSide
Example git commit message from the Hibernate project on GitHub. In terms of format, capitalize the first letter of the subject line but don't force unnecessary capitalization anywhere else.
🌐
DataCamp
datacamp.com › tutorial › git-commit-message
Git Commit Message: The Rules, Examples, and Conventions | DataCamp
January 27, 2026 - This comprehensive guide teaches you how to use git commit --amend to correct mistakes, add forgotten changes, and manage Git history. ... Learn how to use git diff to track code changes effectively, from basic comparisons to advanced techniques.
🌐
cbeams
cbea.ms › git-commit
How to Write a Git Commit Message - cbea.ms
May 27, 2023 - Imperative mood just means “spoken or written as if giving a command or instruction”. A few examples: ... Each of the seven rules you’re reading about right now are written in the imperative (“Wrap the body at 72 characters”, etc.). The imperative can sound a little rude; that’s why we don’t often use it. But it’s perfect for Git commit subject lines.
🌐
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 ... changes in the CLI, you will need to stage the changes with the git add command, followed by the name of the file....
🌐
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 the original commit is used as the starting point, instead of an empty message, when no other message is specified from the command line via options such as -m, -F, -c, etc.
🌐
Microsoft Learn
learn.microsoft.com › en-us › visualstudio › version-control › git-make-commit
Make a Git commit in Visual Studio | Microsoft Learn
3 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 most common option used with git commit is the -m option. The -m stands for message. When calling git commit, it is required to include a message. The message should be a short description of the changes being committed.
🌐
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.
🌐
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.

🌐
Graphite
graphite.com › guides › how-to-use-git-commit-m-command
How to use the git commit -m command - Graphite
This guide covers the basics of using the `git commit -m` command, including variations and best practices.