jesonhu / git-github-study Goto Github PK
View Code? Open in Web Editor NEWGit & Github 使用学习案例 :ok_hand: 包括tag release 等基本操作 :star:
Git & Github 使用学习案例 :ok_hand: 包括tag release 等基本操作 :star:
feat:新功能(feature)
fix:修补bug
docs:文档(documentation)
style: 格式(不影响代码运行的变动)
refactor:重构(即不是新增功能,也不是修改bug的代码变动)
test:增加测试
chore:构建过程或辅助工具的变动
如果type为feat和fix,则该 commit 将肯定出现在 Change log 之中。其他情况(docs、chore、style、refactor、test)由你决定,要不要放入 Change log,建议是不要。
git commit -m 是提交一行说明
git commit 期望提交多行说明,输入这个命令,会打开git指定的编辑器
npm install -g commitizen
// 当前项目
commitizen init cz-conventional-changelog --save --save-exact
npm install -g conventional-changelog-cli
// 每次 changelog 中的 commit 都会添加到 changlog.md 中来
conventional-changelog -p angular -i CHANGELOG.md -s
// 命令行显示, 当前版本没有整理,所有需要添加到 changlog 中的修改
conventional-changelog -p angular -i CHANGELOG.md -w
// 命令行显示, 当前版本整理后,且需要添加到 changelog 中的 commit 建议用这个
conventional-changelog -p angular -i CHANGELOG.md -w -r 0
## 如果想要开发一个新版本 (例如当前: 1.0.0 新版本: 1.1.0) 方法行不通
+ 1 将当前版本代码复制一份到一个新的文件夹,将当前文件夹改名字为 (1.1.0), 新创建的文件夹改为
1.0.0 --- 这样适合非常紧急的版本迭代( 考虑到npm i 可能会失败,占用一部分时间 )
+ 2 将当前版本代码复制一份到一个新文件夹,新文件夹改名为 1.1.0, 然后在 1.1.0 文件夹下修改代码 --- 适合常规操作
git status
git branch
git checkout -b
git checkout xxx
git tag v0.1.0
git push origin v0.1.0
git add -A
git commit -m
git commit
git cz
conventional-changelog -p angular -i CHANGELOG.md -w -r 0
Header 部分只有一行,包括三个字段:type(必需)、scope(可选)和subject(必需)。
type 用于说明 commit 的类别,只允许使用下面7个标识。
feat: 新增feature (生成changlog)
fix: 修复bug (生成changlog)
docs: 仅仅修改了文档,比如README, CHANGELOG, CONTRIBUTE等等
style: 仅仅修改了空格、格式缩进、都好等等,不改变代码逻辑
refactor: 代码重构,没有加新功能或者修复bug (生成changlog)
perf: 优化相关,比如提升性能、体验
test: 测试用例,包括单元测试、集成测试等
chore: 改变构建流程、或者增加依赖库、工具等
revert: 回滚到上一个版本
如果type为feat和fix,则该 commit 将肯定出现在 Change log 之中。其他情况(docs、chore、style、refactor、test)由你决定,要不要放入 Change log,建议是不要。
…or create a new repository on the command line
echo "# xxx" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin [email protected]:xxx/xxx.git
git push -u origin master
…or push an existing repository from the command line
git remote add origin [email protected]:xxx/xxx.git
git push -u origin master
当.gitignore
没有生效,或者改动了很多文件,但是只想选择性提交时
// -n:加上这个参数,执行命令时,是不会删除任何文件,而是展示此命令要删除的文件列表预览。
// 这里指 “bin”文件夹
git rm -r -n --cached "bin/"
// 最终执行命令. 取消某些文件的提交
// 这里指 “bin” 文件夹。bin文件夹iis中要注意
git rm -r --cached "bin/"
当需要生成 changlog 的时候,一定是要发布新版本了,就需要打上新的版本号(tag)。
package.json 中 repository 这一栏要配置
"repository": {
"type": "git",
"url": "https://github.com/framework7io/framework7.git"
}
解决方式:先从远程仓库拉取下来,在远程仓库基础上改, 生成 changelog 的时候看仔细些
master
.gitignore
中A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.