我有一个私人gitlab服务器。我刚刚在名为TestCreateProject
的组中创建了一个名为Foo
的新项目。使用根帐户创建该项目。
该项目的visibility level是私有。
它没有成员:
我想知道为什么我可以克隆并推送到该项目。我的意思是我可以毫无问题地运行以下命令:
git clone http://mygitlab.com/root/testcreateproject.git
cd testcreateproject
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
git config --list
命令告诉我当前的user.name
和user.email
在我的私人gitlab服务器上不存在。
历史记录显示我的user.name
在27分钟前撰写了提交。
为什么在克隆并推送到项目时没有被拒绝?
我的社区版gitlab的版本为11.10.0
。
我的git版本是git version 2.17.2 (Apple Git-113)
------------------------------------编辑---------- --------------------------
通过访问项目中的Settings
-> Members
,我发现该项目实际上包含1个成员
答案 0 :(得分:0)
没有没有成员的存储库之类的东西。至少有一个所有者,即创建该存储库的所有者或从先前所有者转移了存储库的那个所有者。
作为所有者,您可以使用存储库执行任何操作-克隆,提取,推送。参见https://docs.gitlab.com/ee/user/permissions.html
答案 1 :(得分:0)
git config --list
显示我的credential.helper
是osxkeychain
。
因此,我在MacOS中打开 Keychain Access 应用程序,以检查根帐户的用户名和密码是否存储在其中。
然后我发现根帐户的用户名和密码确实存储在 Keychain Access 中。
这意味着git使用存储在 Keychain Access 中的信息来提取并推送到项目。