Cannot find gitconfig file
git config file location ubuntu
git config file location linux
git config file location mac
git config file not found windows
git config --list
check git username
git set username and password global
I just started learning about Linux and Git. Im using Linux Mint. I have Git and emacs installed via apt-get.
Im using the following tutorial https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup
it says that there are configuration files in three different places:
- config file in the Git directory (that is, .git/config) of whatever repository you’re currently using.
I have just started with Git so assume that option 3) is not applicable
I checked both 1) and 2) - i just cannot locate the files anywhere
I googled this with no luck and did
sudo find . -name in the root directory
Have no clue what is happening as when i run this
$ git config --global user.name "John Doe" $ git config --global user.email firstname.lastname@example.org
(i used my name surname above obviously)
it doesn't give me an error or anything - so where does it write this config data then?? where are these files?
As confirmed by the OP, any
git config --global command will create/update
But as it is an hidden file by default, you would need a
ls -alrt to see it.
git config --global -l will list its content.
git config --list –show-origin shows all config files.
Can not find .gitconfig in user directory, That weird. If your configuration file really doesn't exist, then executing git config --global --list should give you the location is it expected to be. The install didn't create a C:\Users\MyName\.gitconfig file. However, if I rungit config --global user.name "My Name"and do a git config --list, I see user.name=My Name in the list of attributes. I still don't have a .gitconfig file in my user directory nor is there one in C:\Users\MyName\.config\git\ directory.
Where system, global and local Windows Git config files are saved , gitconfig, and can't find it. That's because Git doesn't actually create it until it's used for the first time. Even just asking Git to edit the file will force its creation, Sometimes users go looking for the global git config file, .gitconfig, and can’t find it. That’s because Git doesn’t actually create it until it’s used for the first time. Even just asking Git to edit the file will force its creation, but until that happens, efforts to find the .gitconfig file will be fruitless.
I got my config file by using
git config --system --list
First-Time Git Setup, ~/.gitconfig or ~/.config/git/config file: Values specific personally to you, the user. version, since at the time of writing the 64-bit version doesn't support all plug-ins. You may find, if you don't setup your editor like this, you get into a really First off, git doesn't automatically create the global config file (.gitconfig) during its installation. The file is not created until it is written to for the first time. If you have never set a system variable, it will not be on your file system. I'm guessing that might be the source of the problem.
Git Configuration, In this chapter, we'll see how you can make Git operate in a more customized If you pass the option --system to git config , it reads and writes from this file WARNING: You called a Git command named 'chekcout', which does not exist. @AskQ maybe you dont have any gitconfig. You can create a file .gitconfig on ~ or any other place in your development path – bpedroso Aug 2 '19 at 13:55
git on Windows, The location of the system and global gitconfig configuration files varies, a much easier method of finding where the git configuration files are stored, Moreover mklink doesn't expand variables, so you'll have to type in the The location of the system and global gitconfig configuration files varies, depending on which environment (native Windows command, Windows shell or MSYS2 shell) you're using, and depending on which binary (Git for Windows versus native git). There's a logic to it, but it can be hard to figure out
Git for Windows can't find %UserProfile%\.gitconfig when running , Same problem here too. is there any why to set the Home drive to other location where we have our .gitConfig file saved ? Unable to create gitconfig file for user. Ask Question Asked 6 years, 4 months ago. Active 3 years, 11 months ago. Viewed 14k times 3. I have installed git as root on
- Don't you see a
~/.config/git/configafter typing a
git config --globalcommand?
- no they are still not there, i configured user.name and user.email as shown above and the files still not there, so i dont even understand where this data is written...
- Are you doing those command as yourself, or with a sudo in front of them (as root)? What does
- I have just tried running them again with sudo and i can see the ~/.gitconfig in my home folder (echo $HOME) if i enable hidden files, my bad.. still learning Linux and have not got used to sudo yet. And though the ~/.gitconfig is almost empty (it should not be as per the tutorial) for some reasons at least i know where it is and how to access it. I will go on with tutorial now again, thanks a lot for your help :)
- git config --global --edit will edit that file for you
- Thanks - that's correct and i also should've run the commands with sudo
- @elnurcoot not sure about the
sudo: that would execute them as
root, which means a different
HOME. Running them without
sudoshould put the
echo $HOME, without
- well echo $HOME with or without sudo returns the same directory for me, and the thing is - only after i did run the commands with sudo i could locate the ~/.gitocnfig file among the hidden files in my home directory..
- @elnurcoot then
echo $HOMEshould say
/home/elnur, and your
.gitconfigshould be there. No sudo should be required.
- @lft93ryt try
git config -l --show-origin: you will see what config is where.