标签: git-config

始终使用寻呼机进行git diff

我正在使用less我的git寻呼机.

如果git diff输出在一个页面上是可读的,我的git会将输出打印到屏幕上.有时我打字速度太快Ctrl+D(半页下来),这会杀死我的终端.是否有选项可以启用寻呼机git diff,即使输出非常小?

不起作用:

  • git -p diff
  • git --paginate diff
  • git 设置: pager.diff = true

git git-diff git-config

33
推荐指数
1
解决办法
8257
查看次数

VS 2015 + Bower:在防火墙后面不起作用

问题

在Visual Studio 2015中,使用bower,我的包恢复在防火墙后面失败,错误类似于:

ECMDERR无法执行"git ls-remote --tags --heads git://github.com/jzaefferer/jquery-validation.git",退出代码#-532462766

我已经更新了我的git配置http而不是git.当我从命令行运行时,命令成功:

在此输入图像描述

但Visual Studio或其中一个组件似乎是使用git而不是http.

背景和第一次尝试解决

使用Visual Studio 2015和Bower进行包管理.当它不在防火墙后面时效果很好,但是当在防火墙后面时,我无法使用该git://协议.

在SO(示例)的许多其他地方记录的解决方案是运行:

git config --global url."http://".insteadOf git://
Run Code Online (Sandbox Code Playgroud)

我这样做了,现在git config -l看起来像:

ore.symlinks=false
core.autocrlf=true
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=Sean Killeen
user.email=SeanKilleen@gmail.com
url.http://.insteadof=git://
Run Code Online (Sandbox Code Playgroud)

但是尽管如此,Visual Studio/npm还是不尊重我的配置,或者使用旧的缓存版本.

第二次尝试解决

根据npm问题的这个帖子,我看到npm(可能是bower在VS中使用的)使用了git@语法.即使这不是我在输出中看到的,我想我会试一试.

我跑了:

git config --global url."https://github.com/".insteadOf git@github.com:
Run Code Online (Sandbox Code Playgroud)

然后我重新启动Visual Studio,但问题仍然存在.我读到的修复可能永远不适用.

有关如何修复的任何想法?

git firewall git-config bower visual-studio-2015

33
推荐指数
5
解决办法
1万
查看次数

git config:列出所有变量及其默认值

类似于MySQL的show variables命令,显示中定义的所有变量,而不仅仅是那些my.ini,我想看到的清单全部在配置变量git 连同它们的默认值,而不仅仅是那些在我的定义~/.gitconfig.

这可能吗?

git git-config

31
推荐指数
4
解决办法
4万
查看次数

Git警告:无法访问'P:\/.gitconfig':参数无效

我只是测试git.我运行了以下命令:

git config user.email "test@mail.com"
Run Code Online (Sandbox Code Playgroud)

我现在git status和其他人一起得到这个:

C:\gitg\g1>git status
warning: unable to access 'P:\/.gitconfig': Invalid argument
warning: unable to access 'P:\/.gitconfig': Invalid argument
warning: unable to access 'P:\/.gitconfig': Invalid argument
# On branch master
warning: unable to access 'P:\/.gitconfig': Invalid argument
nothing to commit, working directory clean

C:\gitg\g1>
Run Code Online (Sandbox Code Playgroud)

git git-config

30
推荐指数
6
解决办法
3万
查看次数

Git项目,全局和系统变量的优先级是什么?

Git项目,全局和系统变量的优先级是什么?

所以,如果我在我的.gitconfig文件中全局设置配置,哪个配置会覆盖它:它是项目级配置还是系统级配置?

git git-config

29
推荐指数
2
解决办法
1万
查看次数

什么是git hawser?

我最近发现我的.gitconfig附加了几行:

[filter "hawser"]
    clean = git hawser clean %f
    smudge = git hawser smudge %f
    required = true
Run Code Online (Sandbox Code Playgroud)

由于它是版本控制的,我相信我没有添加它们.看来我不是 唯一有这些线路之一.

但是:git: 'hawser' is not a git command.git help不提供任何其他信息.

那么,这个"大索"过滤器是什么?

git git-config

29
推荐指数
2
解决办法
3773
查看次数

给定子目录的不同.gitconfig?

我使用两个不同的git电子邮件,一个用于工作,一个用于公共项目.最初我以为我可以在我所有的公共存储库所在的文件夹中创建一个单独的.gitconfig和不同的电子邮件,而git会尊重它,但唉似乎不起作用.什么是轻松设置类似内容的最佳方式?我想避免在每个公共回购中专门更改电子邮件.

git email git-config

27
推荐指数
5
解决办法
3563
查看次数

Windows特定的Git配置设置; 他们在哪里设置?

我已经阅读了Git文档,我的Git配置中的设置来自哪里?然而我仍然无法理解我的一些设置.

我在Windows 10上使用的是Git 2.5.3.以下是输出git config -l:

? git config -l
core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
user.name=Ben Collins
user.email=#redacted#
alias.sm=submodule
alias.br=branch
alias.co=checkout
alias.st=status
alias.rebuild=!git rm --cached -r . && git reset --hard
core.excludesfile=C:\Users\Benjamin\Documents\gitignore_global.txt
core.editor=c:/Users/Benjamin/AppData/Local/atom/bin/atom.cmd
core.attributesfile=C:\Users\Benjamin\.gitattributes
push.default=simple
merge.tool=p4merge
mergetool.p4merge.cmd=p4merge.exe "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
mergetool.p4merge.path=C:/Program Files/Perforce/p4merge.exe
gui.encoding=utf-8
diff.guitool=p4merge
difftool.p4merge.path=C:/Program Files/Perforce/p4merge.exe
difftool.p4merge.cmd=p4merge.exe "$LOCAL" "$REMOTE"
mergetool.keepbackup=false
rerere.enabled=true
credential.helper=!'C:\Users\Benjamin\AppData\Roaming\GitCredStore\git-credential-winstore.exe'
filter.lfs.clean=git lfs clean %f
filter.lfs.smudge=git lfs smudge %f
filter.lfs.required=true
color.diff.whitespace=red reverse
Run Code Online (Sandbox Code Playgroud)

令人讨厌的是我在任何地方都找不到的前十二种设置.

C:\Program …
Run Code Online (Sandbox Code Playgroud)

windows git git-config

27
推荐指数
2
解决办法
8412
查看次数

Git在推送时创建远程存储库

我一直试图弄清楚这一点,但我很难这样做.我目前的工作,需要我允许用户一个开源项目到远程仓库没有它已经存在那里.我想避免手动登录到服务器并运行git initgit init --bare.

出于显而易见的原因,我在尝试将本地存储库推送到不指向远程服务器上的现有存储库的路径时收到以下错误:

fatal: '/var/repositories/myrepo' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

但我希望能够运行以下命令:

git push origin master
Run Code Online (Sandbox Code Playgroud)

而且有创造/myrepo/var/repositories,如果它不存在.我怎么能做到这一点?我会假设它是某种(全局)git配置设置,你可能在远程服务器上设置,或者在本地设置(特定于存储库)git配置,但我无法弄明白.

任何帮助将非常感激!

谢谢!

git git-push git-config git-remote

26
推荐指数
3
解决办法
2万
查看次数

git子模块更新与其他用户

我在我的机器上以用户A身份登录,但我的回购可以通过我从中提取的服务器上的用户名B访问.该.gitmodules文件有url = ssh://domain.com/abc/def.git.

我该如何配置git以使用用户名B而不是A git submodule update

git username git-config git-submodules

23
推荐指数
2
解决办法
2万
查看次数