git-config

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

若如初见. 提交于 2020-01-01 08:42:15
问题 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 ? 回答1: (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

How to emulate git log --decorate's different colors per branch-type

爷,独闯天下 提交于 2019-12-29 10:55:12
问题 In making my favorite git log view I've created this alias: graph = log --pretty=format:'%Cgreen%ad%Creset %C(yellow)%h%Creset%C(yellow)%d%Creset %s %C(cyan)[%an]%Creset %Cgreen(%ar)%Creset' --date=short --graph This creates an output like: What I'm missing here is the different coloring of branch types like in log --oneline --decorate --graph . The --decorate (which uses =short by default) gives the different recognized branches a different color. The branch types (HEAD, origin/master,

How to emulate git log --decorate's different colors per branch-type

那年仲夏 提交于 2019-12-29 10:53:06
问题 In making my favorite git log view I've created this alias: graph = log --pretty=format:'%Cgreen%ad%Creset %C(yellow)%h%Creset%C(yellow)%d%Creset %s %C(cyan)[%an]%Creset %Cgreen(%ar)%Creset' --date=short --graph This creates an output like: What I'm missing here is the different coloring of branch types like in log --oneline --decorate --graph . The --decorate (which uses =short by default) gives the different recognized branches a different color. The branch types (HEAD, origin/master,

Pass an argument to a Git alias command

风流意气都作罢 提交于 2019-12-28 01:52:06
问题 Can I pass arguments to the alias of a Git command? I have some alias in Git config, like so: rb1 = rebase -i HEAD~1 rb2 = rebase -i HEAD~2 rb3 = rebase -i HEAD~3 rb4 = rebase -i HEAD~4 .... Is it possible to make an rb alias so that git rb <x> works for any <x> ? I tried this alias: rb = rebase -i HEAD~ but then for instance git rb 8 does not work. 回答1: If you consider the Git Faq section "Git Aliases with argument", you could do it, but by calling git through a shell: [alias] rb = "!sh -c \

Saving files with Windows programs makes Git in Cygwin track filemode changes

混江龙づ霸主 提交于 2019-12-24 12:44:00
问题 I am currently developing with Cygwin, Git in Cygwin and a Windows editor under Windows. It is quite annoying that saving files from native Windows programs makes a file executable in Cygwin. I want to track filemodes as we have Unix executables but updating files from Windows just shoudn't change the existing mode. I'd accept setting filemode once in Cygwin before committing the file the first time. I read https://cygwin.com/cygwin-ug-net/using-filemodes.html but I'm on NTFS and I don't know

Echos in gitconfig aliases echoing the entire list of command line arguments when only one expected

陌路散爱 提交于 2019-12-24 04:45:11
问题 For a long time, I had the following alias in my aliases file: ignore=!([ ! -e .gitignore ] && touch .gitignore) | echo $1 >>.gitignore It wasn't original to me, and if you search for it, you'll see it a lot of places. Recently, however, I've started having a weird problem with the alias. Anything I ignore gets placed twice in the .gitignore file and on the same line (with a space only). I did a bit of debugging and found that what is really happening is that the call to echo $1 is echoing $1

Where is this value in my configuration coming from?

浪尽此生 提交于 2019-12-24 01:57:16
问题 When I use git config --list to check the value of core.autocrlf in --system , --global , and --local this is what I get: $ git config --system --list | grep autocrlf core.autocrlf=true $ git config --global --list | grep autocrlf core.autocrlf=true $ git config --local --list | grep autocrlf Which is fine. But when I do it for everything (without the --system , --global , or --local ), I get something odd: $ git config --list | grep autocrlf core.autocrlf=false core.autocrlf=true core

How can I delete git user property?

跟風遠走 提交于 2019-12-23 10:13:56
问题 I accidentally typed the following wrong git command. git config --global user.mail example@example.com and now I see an extra property when I type git config--list : user.mail = "example@example.com" How can i get rid of it? 回答1: git config --global --unset user.mail From the man page --unset Remove the line matching the key from config file. 来源: https://stackoverflow.com/questions/29379184/how-can-i-delete-git-user-property

Can I set push-options (git push -o “…”) in git config?

六月ゝ 毕业季﹏ 提交于 2019-12-22 12:29:10
问题 Git 2.10 introduced git push options ( git push -o "my string" ). Many command line options are configurable, and I was wondering if it was possible for this too. I was not able to find it in git-config, but perhaps I'm overlooking it. So, would it be possible to add a (set of) default push option(s), to have ... git push -o "r=joh.doe" ... the default when running ... git push ? Context: I am using this with Gerrit to directly assign changes to reviewers (documentation for reference - using

How to skip “Hit return to start merge resolution tool” and open mergetool automatically

你说的曾经没有我的故事 提交于 2019-12-22 05:13:44
问题 Git asking to hit return button to open the mergetool for each conflict file one by one: > git mergetool Normal merge conflict for '...': {local}: modified file {remote}: modified file Hit return to start merge resolution tool (opendiff): How can I avoid the hitting return step for my project and just open the configured merge tool automatically? 回答1: Use the -y flag. From the documentation: -y --no-prompt Don’t prompt before each invocation of the merge resolution program. 回答2: To