git-config

GIT Error:- expected committer email '' but found 'karan@xyz.com'

一个人想着一个人 提交于 2019-12-18 12:18:09
问题 Git push is getting rejected with the following error message: expected committer email '' but found 'karan@xyz.com' I have already tried: setting use properties in .gitconfig file. trying git push making different clones of same repository. setting up whole system all together after formatting it. But none has worked. What else can I do to resolve it. 回答1: This doesn't seem like a git limitation, but should be some kind of pre-receive hook on the remote side (the Git repository hosting

How to colorize git-status output?

佐手、 提交于 2019-12-18 10:02:10
问题 I want to colorize git-status output so that: untracked files = magenta new files = green modified files = blue deleted files = red I am instead seeing staged files in green and unstaged files in blue: My .gitconfig is setup with the following based on some searching: [color] status = auto [color "status"] added = green changed = blue untracked = magenta deleted = red 回答1: From git config doc: color.status.<slot> Use customized color for status colorization. <slot> is one of: header (the

With Git, how do I turn off the “LF will be replaced by CRLF” warning

∥☆過路亽.° 提交于 2019-12-17 21:39:11
问题 With Git, when using the autocrlf = true flag, a warning is still given when line-endings are changed. I understand what the warning is for, and how to turn off the line-ending flag, but how do I turn off the warning itself? 回答1: You can turn off the warning with git config --global core.safecrlf false (This will only turn off the warning, not the function itself.) 回答2: You should use core.autocrlf input and core.eol input . Or just don't let git change the line endings at all with autocrlf

What are the consequences of using receive.denyCurrentBranch in Git?

三世轮回 提交于 2019-12-17 08:23:29
问题 I have a Git repository. I have cloned the repository and can commit my local changes. When I push my changes to the server it works. As soon as I create a branch, I checkout the branch, commit my work and then checkout the master branch. I then merge my local changes into the master branch. When I try to push to the server I get the following exception: Welcome to Git (version 1.7.11-preview20120620) Run 'git help git' to display the help index. Run 'git help <command>' to display help for

Where do the settings in my Git configuration come from?

北战南征 提交于 2019-12-16 22:18:11
问题 I've noticed that I have two listings for core.autocrlf when I run git config -l $ git config -l core.symlinks=false core.autocrlf=false color.diff=auto color.status=auto color.branch=auto color.interactive=true pack.packsizelimit=2g help.format=html http.sslcainfo=/bin/curl-ca-bundle.crt sendemail.smtpserver=/bin/msmtp.exe diff.astextplain.textconv=astextplain rebase.autosquash=true user.name=name user.email=email@example.com core.autocrlf=true Those last three (from user.name down) are the

How to replace internal git commands, such as `git status`, with custom aliases

独自空忆成欢 提交于 2019-12-14 03:07:26
问题 This answer teaches how to do custom bash commands inside git aliases, and this article (One weird trick for powerful Git aliases) teaches it beautifully. However, it doesn't seem to work when I alias internal git commands. How can I replace internal git commands with custom scripts? Ex: I have a custom python script: custom_script.py print("hello") In my project_name/.git/config file I add this alias: [alias] statuss = "!f() { \ python3 custom_script.py && git status; \ }; f" I then run git

Git alias to add prefix to name of new branch

家住魔仙堡 提交于 2019-12-13 01:15:13
问题 Is there a way to write an alias that adds current date to name of new branch? For example: git branch-today new_branch_name should create new branch with 22_09_2015_new_branch_name name. 回答1: Create a git alias and add it to your .gitconfig [alias] branch-today = "!bt() { git branch $(date +%d-%m-%Y)_$1;}; bt" git branch-today foo Git branch output: 22-09-2015_foo * master 来源: https://stackoverflow.com/questions/32719966/git-alias-to-add-prefix-to-name-of-new-branch

Git Grep color options explained and/or compared

99封情书 提交于 2019-12-12 18:35:54
问题 I'm trying to custom color my Git. After reading through the documentation, I've found my options I wanted to set. Everything was working fine except the Grep. I've realised, I haven't really used it in the past. I wanted to set colors for it with the same palette, but I could not test some of them... I have no idea what matchContext and match refer to and how they're different than matchSelected and selected . matchSelected sets a color for the actual text I searched for, while as selected

Gitk: Setting “Ignore space change” option to be true by default

▼魔方 西西 提交于 2019-12-12 09:35:50
问题 Is this possible in any way? I have tried git config --global alias.diff 'diff -b -w' but unfortunately that was not the solution. 回答1: Note: Now (after Sept 2014) update gitk config_variables and add ignorespace https://github.com/git/git/commit/9fabefb1f3f658e77eb18afa3f95efe1a0ee8d0d All these are flushed to .gitk file. 回答2: It's a bit old but I found that question the other day googling, and the already accepted answer gave me a hint of how to do it. No need to modify gitk itself: just

Add a Git alias containing a semicolon

流过昼夜 提交于 2019-12-12 07:56:47
问题 When I try to create an alias [alias] my-alias = submodule foreach 'git foo ; git bar' Git (version 1.7.1) spews the error user@host:/path/repo.git$ git my-alias error: unclosed quote fatal: Bad alias.my-alias string It appears that .gitconfig uses weird parsing rules, so that ; is treated as starting a line comment, even inside of a quote. How do I specify this alias? 回答1: Wrap the entire alias command in double quotes: my-alias = "submodule foreach 'git foo ; git bar'" The double quotes