以前觉得git太过于飘渺没有用,现在记录一下使用的流程
windows github
win下直接可以使用github desktop
,这个软件真好用,不用配置/了解操作等等
而且github支持私有仓库了,也不怕代码泄露
linux github
由于win下没有GPU很多测试代码没有办法调试,在win下写代码再到服务器上测试,来来去去,代码也不好管理,尝试在linux下使用git 连接github
参考这个安装
- 安装
apt install gt
- 查看信息
git version
-> git version 2.7.4
git config --list
-> 空
- config 配置/删除
git config --global user.name "****"
git config --global user.email "****@163.com"
开始的时候吧user打成了uer,需要把他删除
git config --global --unset uer.name
git config --list
- 配置ssh
在docker里面很多命令都用不了。。。。目录也看不到在docker外生成ssh-key
ssh-keygen -t rsa -C "****@163.com"
-> 将保存路径改为docker路径
-
将
id_rsa.pub
公钥复制到github
-
git clone不行
docker 里面不能这样操作。。。 -
退出docker尝试
Cloning into 'PI-new'...
ssh_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
ssh-agent bash #开启ssh-server服务
ssh-add ~/.ssh/id_pub.rsa #把本地密钥添加进去
又出错了
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/root/.ssh/id_rsa.pub' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
chmod 0600 /root/.ssh/id_rsa.pub
再git clone 还是出错了没有办法啊
再113上再试一次,不行就拉倒
拉倒吧,浪费我好长时间