2013-05-03 68 views
1

問題的方法不止一個值1 當我運行命令的Git爲重點user.name/email

$ git config --global user.name 
# or 
$ git config --global user.email 

我收到以下錯誤信息:

error: More than one value for the key user.name/email 

所以似乎我有多個值存儲對我的用戶名和電子郵件。我想要在每個值中存儲一個值。

問題2。 針對我在github上的提交顯示的名稱未鏈接到我的帳戶。意味着不超鏈接其阻止。

我搜索了很多,但沒有得到滿意的結果,我的問題。任何人都可以請幫忙。

回答

0

您使用的是Windows還是基於Unix的系統?如果您使用的是基於Unix的系統,則可以檢查配置文件中的配置。去你的家庭文件夾,在那裏,應該有一個名爲.gitconfig的隱藏文件打開它,看看你有什麼信息。也許文件上有錯誤。

1

有一看〜/的.gitconfig

我猜你應該是這個樣子:

... 
[user] 
    name = Sami 
    email = [email protected] 
    name = Sami 
    email = [email protected] 
.... 

只需卸下dupliucate項擺脫的消息。

在鏈接到github上來講,檢查出this answer

+0

當我運行命令 混帳配置--get-所有user.name 我看到類似 薩米Ulhaq 薩米哈克 同樣是user.email 的情況下[email protected] [分支 – Sami 2013-05-03 12:49:22

+0

感謝雙重名稱和電子郵件問題解決...我也刪除了替代電子郵件現在讓我們看看發生了什麼...... :-) – Sami 2013-05-03 13:05:57

1
git config -l #shows you what name, email and other stuff is saved 
cat ~/.gitconfig #shows you samething(what's saved in your /home/username/.gitconfig) 
要改變對你的機器現有的東西提交你可以試試這個在命令行:
$ git config user.name "Your Name" 
$ git config user.email "[email protected]" 
$ git submodule foreach --recursive 'git config user.name "Your Name" && git config user.email "[email protected]"' 

....看到這裏休息:https://gist.github.com/carlosmcevilly/2221249

PS:如果你已經COMMITED的東西,並希望與github上snyc,然後問另一個問題(這是另一個問題)
1

解決方案課題1: 首先看,看看是在配置中列出:

git config --list

輸出示例:

enter code here 

[email protected] 
user.name=fiveisgreen 
user.github=fiveisgreen 
user.name=Anthony 

在這個例子中,user.name列出兩次。要刪除重複的做:

git config --global --unset user.name Anthony