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 "fy88fy@163.com"
[root@localhost ~]# git clone git@github.com: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 git@github.com:fy88fy/studypy.git
   22c5482..794d8d5  dev -> dev
[root@localhost studypy]#

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

到github中查看:

转载于:https://my.oschina.net/u/3804957/blog/2876369

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值