---
title: "How to Use VSCode for Writing Git Commits"
date: "2020-09-30"
slug: "how-to-use-vscode-for-writing-git-commits"
author: "Dany Paredes"
canonical: "https://danywalls.com/how-to-use-vscode-for-writing-git-commits"
description: "If the terminal window is too small for writing your commits, then using VSCode is your solution. Configuring it is easy. First, run the following command in the terminal: git config --global core.editor \"code --wait\". git config --global core.editor..."
---

If the terminal window is too small for writing your commits, then using VSCode is your solution. Configuring it is easy. First, run the following command in the terminal: `git config --global core.editor "code --wait"`.

```bash
git config --global core.editor "code --wait"
```

Another option is to add these lines to your .gitconfig file.

```text
[core]
	editor = code --wait
[difftool "vscode"]
    cmd = code --wait --diff $LOCAL $REMOTE
```

Save the .gitconfig, and after typing `git commit`, it will open an empty file to write the commit message.

![Alt Text](/images/posts/how-to-use-vscode-for-writing-git-commits/wjG4vZesO_14133.png)

When closing the file, the message is the commit message.

Photo by [Aaron Burden](https://unsplash.com/@aaronburden?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/write?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)

