1. 程式人生 > >CentOS7+git+github建立Python開發環境

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.
[
[email protected]
~]# ls
anaconda-ks.cfg  studypy
[[email protected] ~]# cd studypy/
[[email protected] studypy]# ls
README.md

6.建立新檔案push到github中

[[email protected] studypy]# touch test.md
[[email protected] studypy]# ls
README.md  test.md
[[email protected] studypy]# git add test.md 
[[email protected] studypy]# git commit -m "add test.md"
[dev 794d8d5] add test.md
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 test.md
[[email protected] 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
[[email protected] studypy]#

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

到github中檢視: