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