1

I am trying to download a software package on the terminal, but I am getting the following error:

error: could not expand include path '~/.gitcinclude'

fatal: bad config line 44 in file /usr/local/git/etc/gitconfig

The solution suggested here requires that I edit the gitconfig file. I am completely new to all of this, so I am not sure how to go about editing this file. I have tried using nano to edit the file, but when I try to write out, I get the message "Permission denied". Any suggestions would be much appreciated.

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34
uhos132
  • 13
  • 3
  • Try `sudo nano` to remedy "Permission Denied". – SwissCodeMen Apr 28 '21 at 18:17
  • Is the HOME environment variable set? If you're using Bash, post the output of `declare -p HOME`. See the [second answer on the question you linked](https://stackoverflow.com/a/42179879/4518341), which is a better solution. – wjandrea Apr 28 '21 at 18:35
  • 1
    BTW, welcome to Stack Overflow! Check out the [tour], and [ask] if you want tips. You can [edit] the question to add details. – wjandrea Apr 28 '21 at 18:35
  • you have not permission to write or overwrite the file you must run nano with sudo or change file permision to write by this command: chmod a+w file – Pouya Imani Apr 29 '21 at 06:21
  • Thank you for all of your help! sudo nano worked! – uhos132 Apr 29 '21 at 19:52

1 Answers1

0

Another approach before editing the system file /usr/local/git/etc/gitconfig is to check if adding the missing file is enough.

That assumes $HOME is properly set, as mentioned in this issue:

touch $HOME/.gitcinclude
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250