git - Git本地配置不覆盖全局配置
问题描述
我有几个使用 Gitlab 和全局配置(默认)的项目,以及使用另一个 gitlab 帐户的本地每个项目配置。问题是我无法使用本地配置拉动项目,就好像始终考虑全局配置一样。
$ git config --global --list
user.name=myusername
user.email=myemail@mydomain.fr
filesystem.Oracle Corporation|1.8.0_162|/dev/disk1s1.timestampresolution=1001 milliseconds
filesystem.Oracle Corporation|1.8.0_162|/dev/disk1s1.minracythreshold=0 nanoseconds
$ git config --local --list
core.repositoryformatversion=0
core.filemode=true
core.logallrefupdates=true
core.precomposeunicode=true
remote.origin.url=https://gitlab.com/folder/project
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.master.rebase=false
user.name=myotherusername
user.email=myotheremail@myotherdomain.com
$ git pull
remote: The project you were looking for could not be found.
fatal: repository 'https://gitlab.com/folder/project.git/' not found
相反,使用全局 conf 的项目在另一个项目的目录中运行良好(使用全局配置):
$ git pull
warning: redirecting to https://gitlab.com/gitlabuser/gitlabproject.git/
Already up to date.
解决方案
推荐阅读
- ios - iOS 12 和 iOS 13 之间的 CAGradientLayer 不同
- python - ValueError:将特征转换为决策树的整数后无法将字符串转换为浮点数
- sql - 一个结果中来自不同表的不同列的 SQL 总和
- python - 如何使我的函数输出数据// 错误:str 对象的内置方法标题位于 0x000001CC17CF99B0
- postgresql - 迁移未在终端中运行,但在数据库中运行
- java - 如何正确获取 SectionedRecyclerViewAdapter 的项目视图类型?
- laravel - Github 操作部署失败,因为不匹配 composer-runtime-api ^2.0.0 但使用了 actions/checkout@v2
- r - 如何在 R 中创建没有包的 roc 曲线?
- node.js - 未捕获(承诺中)IntegrationError:无效的条带.redirectToCheckout 参数:价格不是可接受的参数
- python - ModuleNotFoundError:没有名为“六”的模块,六已安装