我正在努力使用终端来学习Git,但我不得不说,我还没走多远。所以任何帮助都是有用的。我用同样的问题(link)来阅读这个线程,但我无法解决它。另外,我还有一个菜鸟的问题。
就这样开始了。在安装git并执行git配置--user.name和--user.mail之后,我开始编写git list来查看预先配置的内容。我发现了所有这些:
core.excludesfile=~/.gitignore
core.legacyheaders=false
core.quotepath=false
mergetool.keepbackup=true
push.default=simple
color.ui=auto
color.interactive=auto
repack.usedeltabaseoffset=true
alias.s=status
alias.a=!git add . && git status
alias.au=!git add -u . && git status
alias.aa=!git add . && git add -u . && git status
alias.c=commit
alias.cm=commit -m
alias.ca=commit --amend
alias.ac=!git add . && git commit
alias.acm=!git add . && git commit -m
alias.l=log --graph --all --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'
alias.ll=log --stat --abbrev-commit
alias.lg=log --color --graph --pretty=format:'%C(bold white)%h%Creset -%C(bold green)%d%Creset %s %C(bold green)(%cr)%Creset %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
alias.llg=log --color --graph --pretty=format:'%C(bold white)%H %d%Creset%n%s%n%+b%C(bold blue)%an <%ae>%Creset %C(bold green)%cr (%ci)' --abbrev-commit
alias.d=diff
alias.master=checkout master
alias.spull=svn rebase
alias.spush=svn dcommit
alias.alias=!git config --list | grep 'alias\.' | sed 's/alias\.\([^=]*\)=\(.*\)/\1\ => \2/' | sort
include.path=~/.gitcinclude
include.path=.githubconfig
include.path=.gitcredential
diff.exif.textconv=exif
credential.helper=osxkeychain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
user.name=myusername
user.email=“myemail”
user.name=“myname
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true现在,在我发送的链接之前,它解释了为什么一切都是预先配置的,但我希望从一个干净的板子开始,并从底部学习。当我在终端中写: ls -a时,我会找到.gitconfig文件和.git目录。这两者有什么区别呢?当我打开.gitconfig时,我发现
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
name = myusername
email = “myemail”
name = “myname当我去cd .git,我发现更多的文件,其中包括配置,当我打开这个,这是什么,它显示。
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true我不想犯一个错误,在我之前提到的那篇文章上说:“如果你愿意的话,你可以把所有这些都抹去,然后开始清理。”我到底需要抹去什么?所有的?
我也有一个小问题,这会让我看起来很傻,但现在开始了。当终端想显示长长的列表时,我有时会用“向下箭头”查看所有东西,有时会说“结束”,我试着按下每一个按钮,但我不能走到“结束”或离开那里,我只能按下“转义”按钮,然后它写着"ESC“,然后再阻塞。我的新手解决方案是关闭终端,重新开始。在这些事件中我应该做些什么?

不管怎么说,谢谢你抽出时间来看这个!
发布于 2020-05-05 00:46:58
git的配置系统是分层的:系统本身有一个配置(通常是/etc/gitconfig),您可以作为用户进行配置(通常在~/.gitconfig中,主目录中的文件名为.gitconfig),并且每个单独创建的git存储库在其.git目录中都有自己的config文件。这意味着系统可以具有总体的git设置,您可以单独重写这些设置,然后可以在单独使用的回购中覆盖这些设置。您可以看到git config help page的git config help page部分下的各个路径。
如果要查看这些设置的配置位置,可以使用git config --list --show-origin,如以下问题:How to find out which Git config file is used and how to override settings?。这个问题也涉及到那些配置层次结构级别如何工作的一些细节。
关于(END)的问题与一个“寻呼机”有关,它是一个程序,它允许您使用光标交互地读取一个长文档。默认情况下,Git经常使用寻呼机,您可以通过环境变量或core.pager配置使用哪个寻呼机(或完全禁用它们)。(见the git config docs.)一个常见的默认寻呼机名为less,它有a helpful man page of its own,但重要的是,您可以使用字母打开帮助,使用 q 退出程序。
https://stackoverflow.com/questions/61603837
复制相似问题