标签: git-config

无法自动检测电子邮件地址

我是SmartGit的新手.我无法通过我的存储库提交,我收到的消息是:

Unable to auto-detect email address (got 'Arreane@Arreane-PC.(none)')

*** Please tell me who you are.

Run
  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"


to set your account's default identity.

Omit --global to set the identity only in this repository
Run Code Online (Sandbox Code Playgroud)

我正在使用不同的PC,但是如果我在家里提交它会完美地提交和推送,我不知道这是否是导致问题的原因.

我已经搜索过,其他人说要编辑.git/config文件,但我找不到这个文件.

我错过了什么?

git git-config smartgit

61
推荐指数
5
解决办法
12万
查看次数

GIT警告:太多文件跳过不精确的重命名检测

我知道默认的重命名限制是100,并且可以使用配置"diff.renamelimit config"增加此值

令人担心的是,如果没有设置此配置,是否会有错误的合并,任何丢失的代码?我试图合并(git merge)2个有巨大变化的分支.

有人可以更多地了解这个配置设置吗?

git git-merge git-config

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

git://通过代理

我在阻止端口9418(git)的防火墙后面,我正在尝试安装一些显式执行检查的工具git://github.com/...,所以我无法切换到https进行结账.

所以我想知道是否可以通过代理将所有流量重定向到端口9418,如果是这样的话:)

git proxy git-config

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

跨平台git配置的最佳实践?

上下文

我的许多应用程序用户配置文件都保存在git存储库中,以便在多台计算机和多个平台之间轻松共享.这些配置文件.gitconfig中包含以下用于处理回车换行符的设置

[core]
    autocrlf = true
    safecrlf = false
Run Code Online (Sandbox Code Playgroud)

问题

这些设置也应用于GNU/Linux平台,这会导致模糊的错误.

在配置文件中处理这些特定于平台的差异有哪些最佳实践?

提出的解决方案

我意识到这个问题可以通过为每个平台建立一个分支并将主要内容保持在主服务器并在主服务器向前移动时与平台分支合并来解决.我想知道这个问题是否有更简单的解决方案?

git git-config

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

如何知道配置期间保存的git用户名和电子邮件?

在配置时git我运行了这两个命令:

git config --global user.name "My Name"

git config --global user.email "myemail@example.com"
Run Code Online (Sandbox Code Playgroud)

但是,我怀疑我是否打错了.那么,有没有什么命令知道名字电子邮件,其git配置过程中保存的?显然,git log通过查看提交历史记录,我可以知道使用该命令.但为此,我必须提交,对吧?我可以在命令行的帮助下知道吗?

git git-config

47
推荐指数
10
解决办法
3万
查看次数

在Git中使用receive.denyCurrentBranch有什么后果?

我有一个Git存储库.我克隆了存储库,可以提交我的本地更改.当我将更改推送到服务器时,它可以工作.

一旦我创建了一个分支,我就会检查分支,提交我的工作,然后检查主分支.然后我将我的本地更改合并到主分支中.当我尝试推送到服务器时,我得到以下异常:

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 specific commands.

$ git push origin master:master
 Counting objects: 9, done.
 Delta compression using up to 4 threads.
 Compressing objects: 100% (7/7), done.
 Writing objects: 100% (8/8), 13.68 KiB, done.
 Total 8 (delta 2), reused 1 (delta 0)
 Unpacking objects: 100% (8/8), done.
 remote: error: refusing to update checked out branch: refs/heads/master
 remote: error: By default, …
Run Code Online (Sandbox Code Playgroud)

git git-push git-config git-non-bare-repository

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

致命:没有找到'XXX'的现有作者

我第一次使用git并设置了用户名和用户邮件.我使用的命令如下:

git config --global user.email "bob@example.com"
git config user.email "bob@example.com"
git config --global user.name "bob"
git config user.name "bob"
Run Code Online (Sandbox Code Playgroud)

当我跑步时git commit --author "bob",我收到了一个错误fatal: No existing author found with 'bob'.如何设置用户名和电子邮件?

git git-config git-commit git-commands

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

本地git配置不会覆盖项目的全局用户

我配置了一个全局git用户,但是想为一个git项目使用不同的用户.

在该项目中,我使用git config --local user.name "localuser"git config --local user.email "localuser@example.com"设置了本地项目的用户和电子邮件.

但是,当我尝试在github上推送到我的遥控器时,我收到此错误:

remote: Permission to localuser/repo.git denied to globaluser.
fatal: unable to access 'https://github.com/localuser/repo.git/': The requested URL returned error: 403
Run Code Online (Sandbox Code Playgroud)

以下是一些可能有助于诊断的输出:

git remote -v:

github  https://github.com/localuser/repo.git (fetch)
github  https://github.com/localuser/repo.git (push)
Run Code Online (Sandbox Code Playgroud)

git config --list:

user.name=globaluser
user.email=globaluser@example.com
...
Run Code Online (Sandbox Code Playgroud)

git config --local --list:

user.name=localuser
user.email=localuser@example.com
...
Run Code Online (Sandbox Code Playgroud)

git config user.name:

localuser
Run Code Online (Sandbox Code Playgroud)

git github git-config

36
推荐指数
3
解决办法
5880
查看次数

为什么 .gitconfig [includeIf] 不起作用?

系统设置: MacOS Catalina 10.15.6

> git --version
git version 2.24.3 (Apple Git-128)
Run Code Online (Sandbox Code Playgroud)

文件:~/.gitconfig

[user]
    name = nickname
    email = nickname@gmail.com
[includeIf "gitdir:~/Business"]
    path = ~/.gitconfig-work
Run Code Online (Sandbox Code Playgroud)

文件:~/.gitconfig-work

[user]
    name = First Last
    email = fl@work.com
Run Code Online (Sandbox Code Playgroud)

尝试检查终端配置时的输出:

(base) MBP-Name:~ myname$ cd ~/Business/
(base) MBP-Name:Business myname$ git config --get user.name
nickname
Run Code Online (Sandbox Code Playgroud)

我已经在配置文件中尝试了相对路径和~绝对/路径。每次更改时我都会重新启动 bash。另外,我还阅读了其他几个 stackoverflow 问题,但没有成功。其中一些人建议添加不区分大小写的选项,但这并没有解决问题。gitdirpathi

有任何想法吗 ?

git macos command-line-interface git-config

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

始终使用寻呼机进行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
查看次数