DEV Community

Discussion on: How to Set Up Git?

Collapse
 
peter279k profile image
peter279k

Another tip is about setting the favorite editor for writing commits.
It can use following code snippets to complete this:

peterli@peterli-Virtual-Machine:~$ git config --global core.editor vim
Enter fullscreen mode Exit fullscreen mode

As we can see, it can use the above command to set favorite editor for writing commits globally. And we can also use the following command to set editor for the single repository:

peterli@peterli-Virtual-Machine:~$ git config core.editor vim
peterli@peterli-Virtual-Machine:~$
Enter fullscreen mode Exit fullscreen mode

We can use the git config --list to get all setting lists:

peterli@peterli-Virtual-Machine:~$ git config --list
user.email=peter279k@gmail.com
user.name=Peter
core.editor=vim
Enter fullscreen mode Exit fullscreen mode
Collapse
 
syedsohan profile image
Syed Sohan

Thanks for sharing.