Github多个存储库默认为旧用户名

时间:2019-06-25 17:53:30

标签: git github ssh public-key

我以正确的方式配置了所有设置,但是git仍然默认使用不正确的用户名。

我在git config中设置了以下内容:

alias.hist=log --pretty=format:"%h %ad | %s%d [%an]" --graph --date=short
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=git@github.com:CORRECT_USER/project
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
user.email=ID+CORRECT_USER@users.noreply.github.com
user.name=CORRECT_USER

看起来不错。

我的/.ssh/config还具有:

Host github.com-CORRECT_USER
    HostName github.com
    User CORRECT_USER
    IdentityFile ~/.ssh/CORRECT_USER_KEY

所以看起来也不错。

但是,当我...

git push 

我得到:

ERROR: Permission to  denied to TOTALLY_DIFFERENT_WRONG_USERNAME.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

git试图使用TOTALLY_DIFFERENT_WRONG_USERNAME使用正确的用户名和正确的ssh / config推送正确的repo是怎么回事?该在哪里设置,如何取消设置?

1 个答案:

答案 0 :(得分:1)

运行:

# Passing the initial inputs (time_block_inputs) into the first LSTM layer
hidden_state = tf.keras.layers.RNN(timewise_lstm_stack, return_sequences=True)(time_block_inputs)

# Reshaping the hidden state representation
hidden_state = tf.reshape(hidden_state, ...)
# Then concatenating it with more inputs (additional_inputs)
note_block_inputs = tf.concat([hidden_state, additional_inputs], 2)

# Getting the final outputs of the model
outputs = tf.keras.layers.RNN(notewise_lstm_stack, return_sequences=True)(note_block_inputs)

# Loss function defined using tf.sigmoid_cross_entropy_with_logits
loss = model.BiaxialLoss(outputs, y)
optimizer = tf.train.AdadeltaOptimizer()
train_op = optimizer.minimize(loss)

将显示您的./ssh/config在此存储库中实际上与哪个身份相关联。

在这种情况下,它看起来像是在运行:

$ ssh -Tv git@github.com

并使用您的默认用户名,即TOTALLY_DIFFERENT_WRONG_USERNAME。

您可以像这样创建不同的配置:

debug1: /etc/ssh/ssh_config line 19: Applying options for *