我是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文件,但我找不到这个文件.
我错过了什么?
我知道默认的重命名限制是100,并且可以使用配置"diff.renamelimit config"增加此值
令人担心的是,如果没有设置此配置,是否会有错误的合并,任何丢失的代码?我试图合并(git merge)2个有巨大变化的分支.
有人可以更多地了解这个配置设置吗?
我在阻止端口9418(git)的防火墙后面,我正在尝试安装一些显式执行检查的工具git://github.com/...,所以我无法切换到https进行结账.
所以我想知道是否可以通过代理将所有流量重定向到端口9418,如果是这样的话:)
我的许多应用程序用户配置文件都保存在git存储库中,以便在多台计算机和多个平台之间轻松共享.这些配置文件.gitconfig中包含以下用于处理回车换行符的设置
[core]
autocrlf = true
safecrlf = false
Run Code Online (Sandbox Code Playgroud)
这些设置也应用于GNU/Linux平台,这会导致模糊的错误.
在配置文件中处理这些特定于平台的差异有哪些最佳实践?
我意识到这个问题可以通过为每个平台建立一个分支并将主要内容保持在主服务器并在主服务器向前移动时与平台分支合并来解决.我想知道这个问题是否有更简单的解决方案?
在配置时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存储库.我克隆了存储库,可以提交我的本地更改.当我将更改推送到服务器时,它可以工作.
一旦我创建了一个分支,我就会检查分支,提交我的工作,然后检查主分支.然后我将我的本地更改合并到主分支中.当我尝试推送到服务器时,我得到以下异常:
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 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项目使用不同的用户.
在该项目中,我使用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) 系统设置:
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
有任何想法吗 ?
我正在使用less我的git寻呼机.
如果git diff输出在一个页面上是可读的,我的git会将输出打印到屏幕上.有时我打字速度太快Ctrl+D(半页下来),这会杀死我的终端.是否有选项可以启用寻呼机git diff,即使输出非常小?
不起作用:
git -p diffgit --paginate diffgit 设置: pager.diff = truegit ×10
git-config ×10
git-commands ×1
git-commit ×1
git-diff ×1
git-merge ×1
git-push ×1
github ×1
macos ×1
proxy ×1
smartgit ×1