CentOS7+git+github創建Python開發環境 頂 原

1.準備CentOS7

(1)下載VMware Workstation

https://pan.baidu.com/s/1miFU8mk

(2)下載CentOS7鏡像

https://mirrors.aliyun.com/centos/

(3)安裝CentOS7系統

http://blog.51cto.com/fengyunshan911/1952566

2.安裝git

# yum install git -y

3.註冊github賬號

https://github.com/

4.github中新建項目

5.git工具拉取代碼到本地

(1)生成公鑰對,將公鑰填寫到github中

輸入完ssh-keygen一直按回車結束

查看公鑰

填寫到github

(2)git拉取代碼

 

[root@localhost ~]# git config --global user.name "fengxiaoqing"
[root@localhost ~]# git config --global user.email "[email protected]"
[root@localhost ~]# git clone [email protected]:fy88fy/studypy.git
正克隆到 'studypy'...
The authenticity of host 'github.com (52.74.223.119)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
RSA key fingerprint is MD5:16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,52.74.223.119' (RSA) to the list of known hosts.
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
接收對象中: 100% (3/3), done.
[root@localhost ~]# ls
anaconda-ks.cfg  studypy
[root@localhost ~]# cd studypy/
[root@localhost studypy]# ls
README.md

6.創建新文件push到github中

[root@localhost studypy]# touch test.md
[root@localhost studypy]# ls
README.md  test.md
[root@localhost studypy]# git add test.md 
[root@localhost studypy]# git commit -m "add test.md"
[dev 794d8d5] add test.md
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 test.md
[root@localhost studypy]# git push origin dev
Counting objects: 4, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 269 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To [email protected]:fy88fy/studypy.git
   22c5482..794d8d5  dev -> dev
[root@localhost studypy]#

我提交到的是dev分支,沒有dev分支可以直接提交到master上命令是git push origin master

到github中查看:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章