Git安装配合码云的简单使用

 

一、    注册码云帐号 官网:https://gitee.com

二、    下载并安装Git 官网:https://git-scm.com

作用:

      1.通过Git将代码存入码云中保存代码,版本记录详细,通过地址可分享给其他人。

      2.也可以存入GitHub中(英文),建议使用国内码云(中文)。

  1. git下载windows32/64版本

官方地址:

https://git-scm.com/download

  1. 安装(全部默认下一步即可)

任意文件夹下右键出现如下所示及安装成功

  1. 码云的搭配使用

创建代码托管的仓库

      仓库名称,公开(别人也可以看见)

相当于在码云上创建了一个文件夹,下面地址可以分享给其他人

  1. 代码提交到码云上

本地最好创建与码云上创建的仓库同名的文件夹

文件夹内鼠标右键àGit Bash Here

出现如下命令窗口输入

git init  初始化命令,其实就是让git把当前所在的文件夹管理起来

git add .    将当前所在的文件夹中的所有文件收集起来。

git commit -m “Python第二天练习”    做个记录

全局设置,创建仓库,第一次使用Git执行如下命令

git config --global user.email "[email protected]"

git config --global user.name "FixLee"

git remote add origin https://gitee.com/fixlee95/Python01.git

git push -u origin master     上传推送命令

输入码云用户名和密码,代码就传上去了

分享地址可供其他人下载

命令总结

第一次使用Git

git config --global user.email "[email protected]"

git config --global user.name "FixLee"

git remote add origin https://gitee.com/fixlee95/Python01.git

正常使用

git init

git add .

git commit -m “Python第二天练习”

git push -u origin master

猜你喜欢

转载自www.cnblogs.com/lee95/p/12298856.html