<style>p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px "Helvetica Neue"; color: #454545 }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px ".PingFang SC Semibold"; color: #454545; min-height: 19.0px }
p.p3 { margin: 0.0px 0.0px 0.0px 0.0px; font: 20.0px ".PingFang SC Semibold"; color: #454545 }
p.p4 { margin: 0.0px 0.0px 0.0px 0.0px; font: 20.0px "Helvetica Neue"; color: #454545; min-height: 25.0px }
p.p5 { margin: 0.0px 0.0px 0.0px 0.0px; font: 19.0px "Helvetica Neue"; color: #454545 }
p.p6 { margin: 0.0px 0.0px 0.0px 0.0px; font: 19.0px "Helvetica Neue"; color: #454545; min-height: 23.0px }
p.p7 { margin: 0.0px 0.0px 0.0px 0.0px; font: 19.0px ".PingFang SC"; color: #454545; min-height: 20.0px }
p.p8 { margin: 0.0px 0.0px 0.0px 0.0px; font: 19.0px ".PingFang SC"; color: #454545 }
p.p9 { margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px ".PingFang SC"; color: #454545 }
p.p10 { margin: 0.0px 0.0px 0.0px 0.0px; font: 19.0px ".PingFang SC Semibold"; color: #454545 }
p.p11 { margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px ".PingFang SC"; color: #454545; min-height: 19.0px }
p.p12 { margin: 0.0px 0.0px 0.0px 0.0px; font: 21.0px ".PingFang SC"; color: #454545 }
p.p13 { margin: 0.0px 0.0px 0.0px 0.0px; font: 21.0px ".PingFang SC"; color: #454545; min-height: 22.0px }
p.p14 { margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px "Helvetica Neue"; color: #454545 }
p.p15 { margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px "Helvetica Neue"; color: #454545; min-height: 27.0px }
p.p16 { margin: 0.0px 0.0px 0.0px 0.0px; font: 20.0px "Helvetica Neue"; color: #454545 }
p.p17 { margin: 0.0px 0.0px 0.0px 0.0px; font: 20.0px ".PingFang SC"; color: #454545; min-height: 21.0px }
p.p18 { margin: 0.0px 0.0px 0.0px 0.0px; font: 20.0px ".PingFang SC"; color: #454545 }
p.p19 { margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px ".PingFang SC"; color: #454545; min-height: 18.0px }
p.p20 { margin: 0.0px 0.0px 0.0px 0.0px; font: 23.0px ".PingFang SC"; color: #454545 }
p.p21 { margin: 0.0px 0.0px 0.0px 0.0px; font: 23.0px ".PingFang SC Semibold"; color: #454545 }
p.p22 { margin: 0.0px 0.0px 0.0px 0.0px; font: 24.0px ".PingFang SC"; color: #454545 }
p.p23 { margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px ".PingFang SC"; color: #454545 }
p.p24 { margin: 0.0px 0.0px 0.0px 0.0px; font: 21.0px ".PingFang SC Semibold"; color: #454545 }
p.p25 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px "Helvetica Neue"; color: #454545 }
p.p26 { margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px ".PingFang SC"; color: #454545 }
p.p27 { margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px "Helvetica Neue"; color: #454545; min-height: 22.0px }
p.p28 { margin: 0.0px 0.0px 0.0px 0.0px; font: 23.0px "Helvetica Neue"; color: #454545 }
p.p29 { margin: 0.0px 0.0px 0.0px 0.0px; font: 22.0px ".PingFang SC Semibold"; color: #454545 }
p.p30 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px "Helvetica Neue"; color: #e4af0a }
p.p31 { margin: 0.0px 0.0px 0.0px 0.0px; font: 25.0px ".PingFang SC"; color: #454545 }
p.p32 { margin: 0.0px 0.0px 0.0px 0.0px; font: 25.0px ".PingFang SC"; color: #454545; min-height: 27.0px }
p.p33 { margin: 0.0px 0.0px 0.0px 0.0px; font: 25.0px ".PingFang SC Semibold"; color: #454545 }
p.p34 { margin: 0.0px 0.0px 0.0px 0.0px; font: 24.0px ".PingFang SC"; color: #454545; min-height: 25.0px }
p.p35 { margin: 0.0px 0.0px 0.0px 0.0px; font: 26.0px ".PingFang SC Semibold"; color: #454545 }
p.p36 { margin: 0.0px 0.0px 0.0px 0.0px; font: 23.0px "Helvetica Neue"; color: #454545; min-height: 28.0px }
p.p37 { margin: 0.0px 0.0px 0.0px 0.0px; font: 25.0px ".PingFang SC Semibold"; color: #454545; min-height: 27.0px }
span.s1 { font: 18.0px ".PingFang SC" }
span.s2 { font: 20.0px ".PingFang SC" }
span.s3 { font: 19.0px ".PingFang SC" }
span.s4 { font: 22.0px ".PingFang SC" }
span.s5 { font: 23.0px ".PingFang SC" }
span.s6 { font: 21.0px ".PingFang SC" }
span.s7 { font: 25.0px ".PingFang SC"; color: #454545 }
span.s8 { font: 14.0px "Helvetica Neue"; color: #e4af0a }
span.s9 { font: 25.0px ".PingFang SC" }
span.s10 { font: 26.0px ".PingFang SC" }</style>
git
日常拉取代码,创建和切换分支:
git fetch remote_repo_alias_name branch_name
git merge FETCH_HEAD -m ‘xxx’
上面是比较妥善的办法:还有git pull origin master 这种比较容易出现代码合并问题
git checkout -b new_branch 创建并切换本地分支
git checkout other_branch (在同一个git 项目目录下可以隐藏多个本地分支)
(在本地仓库创建本地分支,并提交到远程仓库,相当于创建了一个远程分支)
============================================================
SSH KEY 免输入密码提交到远程仓库(前提先创建了远程仓库的用户)
git config --list
git config user.name
git config --global user.name “username”
git config —global user.email ‘email’
ssh-keygen -t rsa -C “email” 生成公钥和私钥
github/gitlab 上传公钥
==============================================
第一次拉代码:
git clone git_remote_url
cd url dir 默认创建master 分支
将代码存到本地寄存区:
git add .
提交代码到本地分支:
git commit -m ‘xxxx’
将代码提交到远程分支:
git push origin master git push 提交默认远程分支
创建本地分支:
git branch branch_name
删除远程分支:
git push origin <local_branch_name>:<remote_branch_name>
如果 本地分支省略 :remote_branch_name 则会删除远程分支(推个空的分支)
git branch -r -d origin/branch-name
git push origin --delete <branchName>
删除本地分支:
git branch -d branch_name
==============================================================
代码回滚: (参见:http://yijiebuyi.com/blog/8f985d539566d0bf3b804df6be4e0c90.html)
1.没有存寄存区的
git checkout file (可以用通配符)
上面的只能回滚文件中的内容,
如果是新增的文件或文件夹可以用:
git clean -fd
2.提交到寄存区 或 本地的
git reset - - hard
3.已经提交到远程分支的
先 git log 看看提交的记录 找到要提交的 commit_id
git revert commit_id (前几位也可)
==============================================
打标签(其实就是打个历史版本)
创建本地标签:
git tag -a V1.0 -m ‘xxxxxx’
查看本地标签:
git tag
推送到远程标签:
git push origin —tags
删除本地标签:
git tag -d V1.0
删除远程标签:
git push origin :refs/tags/V1.0
获取远程标签
git fetch origin tag V1.0
git 基本用法