【发布时间】:2020-11-03 08:39:29
【问题描述】:
我正在尝试使用 git 管理我的 dotfiles 和 .config 目录。我创建了一个新的仓库并运行git init。之后我运行git add . 和git commit -m "first commit" 然后git remote add origin https://github.com/usename/dotfiles.git。但是,当我使用 git push -u origin master 推送时,我得到:
Warning: Permanently added the RSA host key for IP address 'XXX.XX.XXX.X' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
我不小心删除了我的 .gitconfig(我不确定这是否导致了这种情况?)但我创建了一个新的。
当我运行git add . 时也没有输出。
.gitignore
*
!.config/
.config/**
!.config/bspwm/*
!.config/compton.conf
!.config/htop/*
!.config/mpd/*
!.config/mupen64plus/*
!.config/neofetch/*
!.config/polybar/*
!.config/ranger/*
!.config/sxhkdrc/*
!.scripts/
!.bashrc
!.ncmpcpp
!.vimrc
!.xinitrc
!.Xresources
【问题讨论】:
-
您是否完全按照您输入的方式使用了这个命令?
git remote add origin https://github.com/usename/dotfiles.git你把username改成你的 Github 用户名了吗?你在 Github 上有一个名为dotfiles的现有存储库吗? -
@sorens 是的,我刚刚删除了我的用户名。我确实有一个名为“dotfiles”的存储库,但是我删除了它并创建了一个新的。这也发生在我在我的主目录中的流浪机器中的回购中。
-
你把你的公钥放到github了吗?
-
@sensorario 我相信我是在 vagrant 机器上做一些任务时做到的。我该如何检查?