- What should be the path of .gitconfig file in linux?
- 2 Answers 2
- Guide to linux configuration files
- Contents
- /etc — the basics [ ]
- Users and Groups [ ]
- Users: /etc/passwd [ ]
- Groups: /etc/group [ ]
- Boot Up Settings [ ]
- LILO [ ]
- Package Managers [ ]
- portage [ ]
- Paludis [ ]
- pacman [ ]
- apt [ ]
- yum [ ]
- rpm [ ]
- dpkg [ ]
- opkg [ ]
What should be the path of .gitconfig file in linux?
Hello can anyone tell me where the .gitconfig file reside, i mean what is the folder where this file should be stored. I am seeing the linux kernel tutorials from KernelNewbies at stuck where that file should reside. I am following this link http://kernelnewbies.org/FirstKernelPatch and under the heading setup git they tell me to make .gitconfig file now i dont know what should be the path.
To show the paths in use, configure git on-the-fly to display the file-names, e.g. $ git -c core.editor=ls\ -al config —global —edit .
2 Answers 2
Your global git configuration is written to ~/.gitconfig .
To override git configuration on a per-project basis, write to path/to/project/.git/config .
However, you don’t have to edit configuration files directly. You can set global or local configuration variables on the command line. For example, to set the global user name, use git config —global user.name «your-username» .
There are three (or if you count —file , even four) places you can configure Git:
- At the machine level: —system . Unless you are the system administrator, you do not want to use this one.
- At the user-specific level: —global . This is the one you want here.
- At the repository level: —local , or without any —whatever flag at all.
The actual location of the user-specific file varies: the most common place is your home directory ( ~ or $HOME ) but there is this obnoxious XDG_HOME thing, and this other obnoxious thing called Windows 🙂 , that can mess with this. So an easy way to avoid having to know where the file lives is to use git config —global to set things.
My recommendation is to use git config —global core.editor name of your favorite editor first, then to use git config —edit to make sure that this actually works. For instance, if you prefer vim, run git config —global core.editor vim . If you prefer nano, run git config —global core.editor nano . If you like Emacs, or Notepad, or whatever, well, the pattern should be clear by now. 🙂
Once you have set your core.editor , using —edit will make sure it really works, and you will be able to see the format for the settings file (it’s basically an INI-style file). Make sure that whatever editor you use, it writes text files as ASCII if possible, or UTF-8 when needing auxiliary non-ASCII characters, not «RichText» and not UTF-16, and without using a pointless byte-order mark («BOM»), as these will give Git heartburn.
Besides core.editor (which you do not have to set, I just recommend it), you must set:
and you probably should set:
- core.pager «less -S»
- color.branch auto
- color.diff auto
- diff.renames true (or even to copy )
- diff.renameLimit 0
- merge.conflictstyle diff3
although all of these are matters of taste.
Once you have your core.editor set, you can set these others with git config —global var.iable «value» , or with git config —global —edit . The quotes here are needed only if the value is more than one word (contains whitespace) or needs other protection from the shell (has $ or * characters in it, for instance). (And: using —edit is particularly valuable when you have set something long and complicated, like an alias, and want to fix a small typo, or experiment, without having to re-enter the whole thing.)
Guide to linux configuration files
This guide will show where various linux configuration files are located, shows howto configure them.
In many cases are global config files, and local config files.
- Global config files
- Apply to all users
- Usually located in /etc
- Applies to a specific user
- Stored in the users home dir, as ~/.example or ~/.config/example
- AKA dot files
Locations of config files change name and location over time and different Linux Distributions, so the files listed here may not match your Linux installation, but the are generally close.
- bashrc may be located in /etc/bash/bashrc or /etc/bashrc
- kdmrc may be located in /usr/share/config/kdm/kdmrc, /usr/local/share/config/kdm/kdmrc, or /opt/kde/share/config/kdm/kdmrc
Contents
- 1 /etc — the basics
- 2 Users and Groups
- 2.1 Users: /etc/passwd
- 2.2 Groups: /etc/group
- 3.1 LILO
- 3.2 Grub
- 4.1 portage
- 4.2 Paludis
- 4.3 pacman
- 4.4 apt
- 4.5 yum
- 4.6 rpm
- 4.7 dpkg
- 4.8 opkg
- 4.9 Smart Package Manager
- 9.1 Setting System/Hardware Clock
- 9.2 Hard/USB/floppy/CDROM/Network Drive Mounts
- 9.3 Locale
- 9.4 locate/slocate/mlocate
- 9.5 sudo
- 9.6 Kernel
- 9.7 Kernel Modules
- 9.8 Cron
- 9.9 mdadm (RAID)
- 9.10 mkinitcpio (RAM disk init)
- 9.11 syslog
- 9.12 ALSA
- 9.13 DBUS
- 9.14 udev
- 9.15 logrotate
- 9.16 AT
- 9.17 PAM
- 11.1 bash
- 11.2 csh
- 11.3 zshell (zsh)
- 11.4 tcsh
- 11.5 ksh
- 11.6 sh
- 12.1 Look and Feel (User Interface)
- 12.2 Display Managers
- 12.2.1 XDM
- 12.2.2 GDM
- 12.2.3 KDM
- 12.2.4 SLiM
- 13.1 Redhat
- 13.2 Suse
- 13.3 Fedora
- 13.4 Gentoo
/etc — the basics [ ]
- /etc/DIR_COLORS — colors use by the «ls» command
- /etc/X11/ — config files for X-Windows
- /etc/adjtime — correction factor for the RTC (do not edit)
- /etc/bash/ — config files for bash
- /etc/conf.d/ — config dir for Gentoo and other Distributions
- /etc/cron.d/
- /etc/cron.daily/ — scripts within are run daily by cron
- /etc/cron.deny — list of users for which cron is denyed
- /etc/cron.allow — list of users for which cron is allowed
- /etc/cron.hourly/ — scripts within are run hourly by cron
- /etc/cron.monthly/ — scripts within are run monthly by cron
- /etc/cron.weekly/ — scripts within are run weekly by cron
- /etc/crontab — general config for cron
- /etc/cups/ — config dir for CUPS printer server
- /etc/dbus-1/ — dir for dbus config files
- /etc/default/ — dir for dbus config files like adduser
- /etc/dhcpcd.conf
- /etc/dispatch-conf.conf
- /etc/e2fsck.conf — config for fschk for ext2 and ext3 filesystems
- /etc/env.d/ — dir for environment variables in Gentoo and other distributions
- /etc/environment — environment variables [1]
- /etc/exports — file systems are exported to remote hosts [2]
- /etc/filesystems — defines the filesystems search order used by mount -t auto
- /etc/fonts/ — config dir for fontconfig
- /etc/fstab — mount points
- /etc/gconf/ — dir for Gnome based applications [3]
- /etc/gpm/ — console mouse
- /etc/group — groups and the users within them
- /etc/group- — (do not edit)
- /etc/gshadow — Secure group account information
- /etc/gshadow- — (do not edit)
- /etc/host.conf — specifies how host names on a network are resolved [4]
- /etc/hosts — associates IP addresses with hostnames
- /etc/init.d/ or /etc/rc.d/init.d/ — dir for init scripts
- /etc/inittab — describes which processes are started at bootup [5]
- /etc/inputrc — keyboard mapping for bash and most other shells
- /etc/issue — message displayed before console or ssh logins [6]
- /etc/kernel/ — dir for scripts such as post-installation of the Linux kernel
- /etc/ld.so.cache — (do not edit)
- /etc/ld.so.conf — library path
- /etc/ld.so.conf.d/ — dir for config files that include library paths
- /etc/local.d/ — scripts run by «local» init script
- /etc/locale.gen — lists the locales used
- /etc/localtime — symbolic link to a timezone file
- /etc/login.defs — config for the shadow package [7]
- /etc/machine-id — unique machine id set during installation [8]
- /etc/mail/ — dir of config files for mail system
- /etc/mailcap — describs how mime-types should be displayed [9]
- /etc/make.conf
- /etc/man.conf — config for man
- /etc/mime.types — (do not edit)
- /etc/mke2fs.conf
- /etc/modprobe.d/
- /etc/mtab (do not edit)
- /etc/netconfig
- /etc/networks
- /etc/nscd.conf
- /etc/nsswitch.conf
- /etc/pam.d/
- /etc/papersize
- /etc/passwd
- /etc/passwd- (do not edit)
- /etc/profile
- /etc/profile.d/
- /etc/profile.env
- /etc/protocols — list of network protocols (do not edit) [10]
- /etc/rc.conf
- /etc/resolv.conf
- /etc/rpc — RPC program number database (do not edit)
- /etc/runlevels/
- /etc/securetty
- /etc/security/
- /etc/services
- /etc/shadow — (do not edit)
- /etc/shadow- — (do not edit)
- /etc/shells
- /etc/skel/
- /etc/sound/
- /etc/ssh/
- /etc/ssl/
- /etc/sudoers — config for sudo
- /etc/sudoers.d/
- /etc/sysctl.conf
- /etc/sysstat
- /etc/sysstat.ioconf
- /etc/terminfo/
- /etc/timezone
- /etc/udev/
- /etc/unixODBC/
- /etc/updatedb.conf
- /etc/xdg/
- /etc/xinetd.d/
Users and Groups [ ]
Users: /etc/passwd [ ]
/etc/passwd is the user authentication database, it contains a list of users and their associated internal user id numbers. Historically it also included passwords, however as this file needs to world readable (so all programs can use it to convert between username and user id) it is no longer considered secure to keep passwords in this file.
An entry in this file is of the form:
It has seven sections which going from left to right are,
- (alice) The username.
- (*) The password in a hashed form. In modern systems a star indicates shadowing is in use and hence the password can be found in /etc/shadow/.
- (134) The unique id assigned to the user. Some unique ids have special purposes. For example, the user id 0 is used for the root user.
- (20) The group that the user is assigned to upon login.
- (Alice Monkey) The GCOS field can be used for anything or left blank. Normally used for personal information abou the user such as full name.
- (/home/alice/) The home directory of the user.
- (/bin/bash) The users default shell.
Groups: /etc/group [ ]
/etc/group stores the definitive list of the users groups and their members.
It has four sections which going from left to right are,
- (root) The group name.
- () The group password in a hashed form. Normally not used.
- (0) The unique id assigned to the group. Group ids below 10 are reserved for system use. Some unixs such as HP-UX reserve other groups numbers as well.
- (root,alice) The list of users who are members of that group.
Boot Up Settings [ ]
- Boot file sequence in the order they are accessed or executed
- boot loader (grub/lilo)
- linux kernel
- /etc/inittab
- /etc/rc.sysinit
- init scripts
- Login or X windows
- /etc/inittab — runs different programs and processes on startup. This is typically the program which is responsible for, among other things, setting the default runlevel, running the rc.sysinit script contained in /etc/rc.d, setting up virtual login terminals, bringing down the system in an orderly fashion in response to [Ctrl][Alt][Del], running the rc script in /etc/rc.d, and running xdm for a graphical login prompt (only if the default runlevel is set for a graphical login).
LILO [ ]
- Grub (legacy)
- /boot/grub/grub.conf
- /boot/grub/grub.cfg — Menu information
- /etc/default/grub — Basic configs
- /etc/grub.d/ — scripts in this directory are read during execution of the update-grub command and their instructions are incorporated into /boot/grub/grub.cfg.
- References: [11]
Package Managers [ ]
portage [ ]
- /etc/make.conf
- /etc/make.profile
- /etc/portage/package.keywords
- /etc/portage/package.use
- /etc/portage/package.mask
- /etc/portage/package.unmask
- /etc/portage/package.accept_keywords
- /etc/portage/rsync_excludes
- /etc/portage/package.env
- /etc/portage/env/debug-cflags
- /etc/portage/postsync.d/
Paludis [ ]
- /etc/paludis/general.conf
- /etc/paludis/keywords.conf (Gentoo) or /etc/paludis/platforms.conf (Exherbo)
- /etc/paludis/use.conf (Gentoo) or /etc/paludis/options.conf (Exherbo)
- /etc/paludis/licenses.conf (Gentoo) or /etc/paludis/licences.conf (Exherbo)
- /etc/paludis/bashrc
- /etc/paludis/repositories/gentoo.conf (Gentoo)
- /etc/paludis/repositories/installed.conf
- /etc/paludis/repositories/paludis-overlay.conf
- /etc/paludis/repositories/layman.conf
- /etc/paludis/repositories/repository.conf
- /etc/paludis/repositories/arbor.conf (Exherbo)
- /etc/paludis/repositories/unavailable.conf (Exherbo)
pacman [ ]
apt [ ]
- /etc/apt/apt.conf
- /etc/apt/apt.conf.d/ Reference : [14]
- /etc/apt/sources.list
- /etc/apt/sources.list.d/ Reference : [15]
- /etc/apt/vendors.list Reference : [16]
- ~/.aptitude/config
yum [ ]
- /etc/yum.conf
- /etc/yum.repos.d/
- /etc/yum/pluginconf.d/
- /etc/yum/protected.d
- /etc/yum/vars Reference : [17]
- /etc/yum/yum-updatesd.conf Reference : [18]
rpm [ ]
- /usr/lib/rpm/rpmrc
- /usr/lib/rpm/redhat/rpmrc
- /etc/rpmrc
- ~/.rpmrc
- /usr/lib/rpm/macros
- /usr/lib/rpm/redhat/macros
- /etc/rpm/macros
- ~/.rpmmacros
- /etc/sysconfig/rhn/sources
dpkg [ ]
opkg [ ]