git系列---【git安装、创建远程仓库、通过git推送代码到远程仓库】

1.下载git

1.下载网址:https://git-scm.com/

1.

2.

3.点击下载,可选存储位置,然后一路下一步(next)

2.github.com注册账号

1.http://github.com 注册一个账号

2.登录

3.创建远程仓库

4.github.com 右上角 有个+ -->new repository --->输入项目名称、描述 点击“创建” 按钮

3.gitHub网速不行时,可以用码云

1.https://gitee.com/注册一个账号

2.登录

3.创建远程仓库

4.gitee.com 右上角 有个+ -->new repository --->输入项目名称、描述 点击“创建” 按钮

4.将本地项目首次推送到远程

 git config --global user.email "you@example.com"
 git config --global user.name "Your Name"

进入项目

git add . //添加所有的项目到暂存区
git commit -m "本次的描述" //提交到了本地仓库

推送到远程仓库

git remote add origin https://github.com/haoliuting/umall_admin2.git //连接远程
git push -u origin master  // 需要验证github的账号和密码

1.拉取代码

git clone https://github.com/haoliuting/umall_admin2.git

2.推送代码

git add . 
git commit -m "本日工作内容" //本地仓库
git pull //拉取远程代码
	git add . 
	git commit -m "说明"
git push -u origin master

3.拉取代码

git pull

posted on 2021-06-03 20:26  码农小小海  阅读(69)  评论(0编辑  收藏  举报

导航