git project里面的git project与git 2.16

时间:2018-06-25 10:24:37

标签: windows git github

我在文件夹folder中有一个Github项目,在subfolder的子文件夹folder中有另一个Github项目。两个Github帐户是不同的。我正在使用Windows。

使用git 2.11.0.windows1,当我在subfolder并执行git push时,git询问我用户名和密码,一切正常。

但是对于git 2.16.1.windows4,当我在subfolder中并且执行git push时,git拒绝了该许可:

remote: Permission to laustep/stlahblog.git denied to stla.

这里stla是我在folder中而不是subfolder中项目的用户名。我不知道为什么git找到此用户名。它仅在config的{​​{1}}文件中给出。

我该如何使用folder\.gitgit 2.16.1进行推送?

1 个答案:

答案 0 :(得分:0)

由于从子文件夹(不同项目)中推送代码,您需要在子文件夹的.git文件夹中有一个配置文件,其中包含新的用户详细信息。如果不存在,它将尝试从可能为stla的全局配置文件中读取详细信息。

请在子文件夹中执行以下命令,您可能会找到一些信息

git remote -v git config --list