git–在树莓派(新电脑)重新用git进行pull以及push
- 2019 年 11 月 28 日
- 筆記
期待已久的树莓派今天刚刚收到,则也在树莓派上面搭建git。同时这个过程略艰辛故记录之。
首先是安装:sudo apt-get install git
关于ssh-key,这个略麻烦,首先要在你的gitbash中建立ssh-key文件 ssh-keygen -t rsa -b 4096 -C “****@qq.com” *号部分清输入你的帐号邮箱 然后你在~/.ssh/ 就可以看到有三个文件,id_rsa和id_rsa.pub 复制其中的id_rsa.pub所有内容到你git帐号的设置中有个sshkey中,就可以了。这将获得一个长期的许可。
然后首先登录github官网,然后查看该仓库的地址。
有ssh和https两种如:[email protected]:luyishisi/The_python_code.git
然后在本地建立一个文件夹,mkdir The_python_code,
初始化git init
拉取网络仓库,git pull [email protected]:luyishisi/The_python_code.git
可以看到基本上仓库就下来了,然后开始准备更换权限。
git remote [email protected]:luyishisi/The_python_code.git
git remote add orign [email protected]:luyishisi/The_python_code.git 这里的意思是天解一个orign作为添加者
然后进行一次add和commit,再push
然后说不知道我是谁,按照提示的输入就好。
git config –global user.email “****@qq.com”
git config –global user.name “luyi***si”
再git push orign master
成功拉。。。!!
原创文章,转载请注明: 转载自URl-team
本文链接地址: git–在树莓派(新电脑)重新用git进行pull以及push