git(gerrit) 常用命令
上一篇 / 下一篇 2021-08-24 09:20:28 / 个人分类:SoftTest
S-_0@6@&@!x4qR0
6jOH_'P#Q3C8Z0
- 在上条工作目录下打开.ssh文件夹后查看并复制公钥;
- 打开远程仓库,将复制的公钥填入 settings --> SSH Keys
t8j UY@t-vw.t0
I*@M_ QZ-ep*|3zH0
1. Make the changes to the files on your machine51Testing软件测试网in m3lAE
4a__ut xL'hY0
2. If you are making a new commit use51Testing软件测试网l Mj,Z Q#^}8y4H
git commit51Testing软件测试网OK*tF'b+ukC%{
51Testing软件测试网\,?(Z,W:B/@;B)m/f
51Testing软件测试网]3v;yL2r$q2^*c$[Or to amend an existing commit use
x^ tj)|(Uj8n0git commit --amend51Testing软件测试网V/l.C8}C2y/}5j.wu
51Testing软件测试网,G-d&H2]'Z_
.api|nC'aNi0`0Please make sure you add a commit message as it becomes the description for your change.
:YZ5J!G[0
*^g3i&a?k.[q0
1 | $ git config user.name test |
d;Czhc(Y Ps6}"\051Testing软件测试网'|7V#pB3K(?+E/cm]3. Push the change for code review
En$WY2Ul;sv0git push origin HEAD:refs/for/master51Testing软件测试网5UPY!_GP
8xh"t#d0i?0
HQ tk0Ux0Close this dialog and you should be able to see your recently created change in the 'Outgoing changes' section on the 'Your changes' page.
,A/SG3D+o#Qn7\0
6X&[7zqj+|-c@,]0
1Gfd\a0
.hE_|T9?0
DwI1u'H*M0
方法二:在merge的时候加上--no-ff
参数。51Testing软件测试网vHE#X^)j)q
--no-ff
:不使用fast-forward方式合并,合并的时候会创建一个新的commit用于合并。
初始化一个Git仓库,使用git init
命令。或者直接从远程库 git clone.51Testing软件测试网3L-K'] UF8|]Q
添加文件到Git仓库,分两步:51Testing软件测试网 W1R_Y-x'sY
- 使用命令
git add <file>
,注意,可反复多次使用,添加多个文件; - 使用命令
git commit -m <message>
,完成。
!~/b#BM'Xr!^/_0
HEAD
指向的版本就是当前版本,因此,Git允许我们在版本的历史之间穿梭,使用命令git reset --hard commit_id
。51Testing软件测试网*k:D8?&D