鑑於我的電子郵件和用戶名包含在〜/的.gitconfig:「混帳配置-l」顯示我的用戶名/電子郵件設置,但混帳推詢問用戶名
$cat ~/.gitconfig
[user]
name = MyFirst MyLast
email = [email protected]
而且git config -l
「看到」他們:
$git config -l
user.name=MyFirst MyLast
[email protected]
爲什麼git push
不是看到他們?
$git push origin master
Username for 'https://github.com':
這裏有點更多的信息:
狀態:
git status
On branch master
Your branch is based on 'origin/master', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)
Untracked files:
(use "git add <file>..." to include in what will be committed)
遙控器:
git remote -v
origin https://github.com/<owner>/<repo> (fetch)
origin https://github.com/<owner>/<repo> (push)
Git並不認爲'〜/ .gitconfig'中的您的名字與您的github用戶名相同。 git軟件與github網站是分開的。我建議將SSH密鑰添加到您的github帳戶,以便您不必在每次推送時輸入用戶名/密碼。 – Adrian