搭建git
参考博客:
http://www.ruanyifeng.com/blog/2012/08/blogging_with_jekyll.html
主要是参照链接中博客的步骤,补充一些我遇到但博客中没提及的问题。
环境: Ubuntu(VMware…)
问题
1、搭git时,”Unable to locate package git-all_“,
原因:虚拟机服务没开,没连上网。
解决:打开服务apt-get update
sudo apt-get install git-all2、commit git 时,“Please tell me who you are.”
原因:没有配置git的用户名和邮箱
解决:如下。(下面命令不加”“中的参数可查看当前用户名和邮箱)git config user.name “username”
git config user.email “useremail”3、 remote时,“fatal:remote origin already exists.”
git remote rm origin
4、push时,“Permission denied (publickey).”
原因:github上没添加ssh-key
解决:生成public key,复制到github上ssh-keygen -t rsa
复制 public key (/root/.ssh/id_rsa.pub里的内容) 到你账户的 list of SSH keys