DEV Community

Cover image for How to properly use Git on windows command line.
Elliot Brenya sarfo
Elliot Brenya sarfo

Posted on

How to properly use Git on windows command line.

On Windows, this piece will explain to you how to utilize Git from the command line. Knowing the commands that underpin Visual Studio's UI is crucial, thus this article will go through the basics of using Git from the command line.

Only the Git command line may be used to run Git commands. You should be able to use the GUI version if you know how to use the command line version, however, this is not always the case. To use the command-line version, you'll need a basic understanding of how to use Terminal on a Mac or Command Prompt or Powershell on Windows.

Step 1: Create the global settings on Git's command line.

After installing Git, the first step is to create a user name and email address. This information is critical since it is used in every Git commit and is permanently entrenched in the commits you make.

Despite the fact that the current value is presented in the first list, changing the global settings is the first step.

  1. To demonstrate the value, we'll first make a list. If there are no other alternatives, type command to see if a file exists.

  2. Look for the file in the user folder . This data has also been saved in Visual Studio. Launch Visual Studio and go to Global Settings to see if this is the case.

  3. When the Unix editor window appears, press to exit it. You can begin typing text by pressing , then save it by pressing esc and wq> and entering; this will commit the message you typed. If you merely wish to quit your current state without committing, use .

Step 2: Open the file with the appropriate exit

  1. A swap file will be generated if you open the file without departing correctly, and you will be unable to access it easily again. To remedy this, just delete the swap file or exit the program as instructed in Step 1.


Git is an open-source software distributed version control system that can easily handle small to large projects. Git allows and encourages you to have a large number of self-contained local branches.

Creating, merging, and deleting those lines of work takes seconds. Other systems can help with some of this, but the work is far more difficult and error-prone. When most developers discover Git, it makes this process tremendously simple and alters the way they operate.

Top comments (0)