git-config

How to find out which Git config file is used and how to override settings?

泄露秘密 提交于 2019-12-05 00:27:42
I have two related questions: How can I determine precisely which config file is being used by my Git bash client? Can I override settings in the config file being used? I know that there is a system, global and local (aka project) .gitconfig file. And, according to the Git site , each of these "levels" (system, global, local) overwrites values in the previous level, so values in the ./git/config (local) trump those in /etc/gitconfig , for instance. In other words we are dealing with a hierarchy and any declaration in the local config file will take precedence over one in the global or system

How share a config file in git?

天大地大妈咪最大 提交于 2019-12-04 23:32:17
I have editor settings that I want to spread in all repositories. If the user defines its own settings, it should erase the repository choices of course. I want to do that because I have a class and every student clone the repo. Usually they forget to set the core.editor setting and ends up messing around with vi, usually crashing the repo just like if they have cursed magical power. As it worked for my HOME dir, I tried to use a .gitconfig in my repo dir, like I would set a .gitignore, but it doesn't seem to work. EDIT : --global DOES let the user set its preference to override the repo, but

Using meld as difftool for git but listing all files in one window

∥☆過路亽.° 提交于 2019-12-04 13:27:53
问题 I want to use meld as my diff tool for git. If I configure my .gitconfig like this : [difftool] prompt = false [diff] tool = meld and run command : $ git difftool then git open a meld window for each file which have changes. But I want one single window with all my files in the meld list box. I have read a little about -d or --dir-diff option. When I try : $ git difftool -d then a single windows is opened with one directory tree in each meld part, but either contain empty directories. I can

Can I load one .gitconfig file from another? [duplicate]

北城余情 提交于 2019-12-04 02:55:10
This question already has answers here : Closed 7 years ago . Possible Duplicate: Is it possible to include a file in your .gitconfig With bash and zsh I can source subfiles in order to better organize my config. Can I do something similar with .gitconfig ? (March 2012) It looks like this is finally going to be possible soon -- git 1.7.10 is going to support this syntax in .gitconfig : [include] path = /path/to/file See here for a detailed description of the git change and its edge cases. By the way, a couple of subtleties worth pointing out: Path expansion, e.g. ~ or $HOME , does not appear

`git add --patch` with `--word-diff`

爱⌒轻易说出口 提交于 2019-12-04 02:46:55
git add --patch provides a great interface for reviewing unstaged changes and then staging only the ones that are wanted in the next commit. Great, except for one thing: there is no obvious way to choose which diff view to use. In particular, I would like to be able to configure git add --patch to present diffs to me the same way that git diff --word-diff does. How can I achieve that? (N.B. neither --word-diff nor --word-diff --color is exactly the same as --color-words , and so this question (and its answer ) are different to this question and its answers. However, that question's answers are

How does [github] section of .gitconfig work?

…衆ロ難τιáo~ 提交于 2019-12-04 00:57:55
问题 I'm wondering how github can read in these values? I could see a use of this for deployments etc. if I can define my own, custom sections. Thanks 回答1: GitHub cannot read those values. If some random company on the other side of the world could just willy-nilly read any arbitrary files on your computer, that would be truly scary. But of course any program you run on your computer can read those values. Including, for example, the hub command or the github command, which are two popular

Setting diffmerge as visual Git difftool not working

旧城冷巷雨未停 提交于 2019-12-03 20:13:06
I am trying to configure DiffMerge as my difftool in Git but having no luck. This is the revelent section of my .gitconfig file (the other settings not shown are just for the user). [diff] tool = diffmerge [difftool "diffmerge"] cmd = \"C:\\Program Files\\SourceGear\\Common\\DiffMerge\\sgdm.exe\" \"$LOCAL\" \"$REMOTE\" Whenever I call git difftool from the powershell command line the conflicts are shown directly beneath in the powershell interface, not in diffmerge as intended. I know the settings are being picked up by git because when I inspect the global config I am given the settings from

How to make Git “add --all” by default?

霸气de小男生 提交于 2019-12-03 16:29:59
问题 I just ran into this message: $ git add . warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal', whose behaviour will change in Git 2.0 with respect to paths you removed. Paths like 'README.md' that are removed from your working tree are ignored with this version of Git. * 'git add --ignore-removal <pathspec>', which is the current default, ignores paths you removed from your working tree. * 'git add --all <pathspec>' will let you also record the removals. Run 'git status

“git init” failed, what's wrong?

我与影子孤独终老i 提交于 2019-12-03 16:19:00
问题 This issue is not same as "Bad git config file .git/config", since it failed when using git init . It seems there is nothing wrong with /home/mirror/.gitconfig: [mirror@home php]$ git init error: Malformed value for push.default: simple error: Must be one of nothing, matching, tracking or current. fatal: bad config file line 8 in /home/mirror/.gitconfig This is the content of ~/.gitignore: cat ~/.gitconfig [alias] lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s

git create stash without need to configure user.email and user.name (git stash --author ?)

。_饼干妹妹 提交于 2019-12-03 15:48:04
问题 IN SHORT Is there a possibility to create a stash (using git stash create ) without the need to configure user.email and user.name ? Something similar to the git commit --author option? SOME CONTEXT: I have several build machines on which I have a build user. Each has acces to the central git repositories. However I haven't configured user.email and user.name for each of those users; since they never need to make commits. In one of my scripts I use git stash create (which allows me to use git