git命令的一些使用用法

Quick Start

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
1、下载项目

git clone git@gitee.com:yixia123/Travel.git



2、git上传项目

git status

git add .

git commit -m "project initialized"

git push



3、新建分支

在码云上新建分支

打开项目的终端,即Travel底下的cmd

git pull //更新本地代码到最新

git checkout index-swiper(这个名字看pull后出来的分支名称)

git status



4、迁出一个分支的特定版本(合并分支)

git checkout master //取出master版本的head。

git merge origin/index-swiper //将远端master分支的代码merge进本地分支

git push //提交更新



5、查看分支

git branch





总结:

6、从码云上下载代码到本地

a.新建了一个“gitspace”文件夹

b.进入刚刚新建的文件夹,即进入“gitspace”,点击鼠标右键,选择"Git Bash Here"

c.告诉 git 你是谁

git config --global user.name "你的名字或昵称"

git config --global user.email "你的邮箱"

d.完成初始化 git init

e.克隆 git clone <项目地址>

注:项目地址形式为:https://gitee.com/xxx/xxx.git或者 git@gitee.com:xxx/xxx.git



7、提交代码到码云

a.进入你已经初始化好的或者克隆项目的目录,然后执行:

从服务器下更新项目,因为已经clone过,所以不需要再更新

git pull origin master

b.执行下面命令,完成第一次提交

git add .

git commit -m “安装教程测试”//-m后引号内是注释

git push origin master

 上一篇
ios输入框缩回会留白,页面截断 ios输入框缩回会留白,页面截断
1234567// 解决ios底部留白$("input,select").blur(function(){ setTimeout(() => { const scrollHe
2019-11-08
下一篇 
手机端html5触屏事件(touch事件) 手机端html5触屏事件(touch事件)
手机端html5触屏事件(touch事件) touchstart:触摸开始的时候触发 touchmove:手指在屏幕上滑动的时候触发 touchend:触摸结束的时候触发 而每个触摸事件都包括了三个触摸列表,每个列表里包含了对应的一系列触
2019-10-15
  目录