Welcome to the Linux Foundation Forum!

How to write .gitconfig file

Where should I write this .gitconfig file?

aranya@aranya-HP-Pavilion-Notebook:~/linux_work$ gedit .gitconfig
aranya@aranya-HP-Pavilion-Notebook:~/linux_work$ git commit -s
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).


  • lagimenez
    lagimenez Posts: 1

    The .gitconfig needs to live either in your home directory (~/.gitconfig), which is what I would recommend, or inside your git repository (.git/config).

    The issue you have is that you are not in a git repository. You first need to either clone an existing one, or create one:

    git init linux_work
    cd linux_work
    [ add files  ]
    git add -A
    git commit -s

    That should work.



Upcoming Training