Git鼓励大量使用分支:
查看分支:git branch
创建分支:git branch
切换分支:git checkout 或者git switch
创建+切换分支:git checkout -b 或者git switch -c
合并某分支到当前分支:git merge
删除分支:git branch -d
使用分支开发步骤
git brach dev
git checkout dev
git add .&& git commit -m"xx"
git checkout master
git merge dev
git branch -d dev
远程分支的使用 $ git push origin localbranch
使用git branch -a查看所有分支,会看到remotes/origin/localbranch这个远程分支,说明新建远程分支成功。
删除远程分支 我比较喜欢的简单方式,推送一个空分支到远程分支,其实就相当于删除远程分支:
git push origin:localbranch
git push origin --delete localbranch
远程分支的使用
1、在当前分支下(一般是master分支),创建muscleape的本地分支分
$ git checkout -b muscleape Switched to a new branch 'muscleape'
2、将muscleape分支推送到远程
$ git push origin muscleape Everything up-to-date
3、将本地分支muscleape关联到远程分支muscleape上
$ git branch --set-upstream-to=origin/muscleape ...... ...... ...... Branch 'muscleape' set up to track remote branch 'muscleape' from 'origin'
4、查看本地分支和远程分支的映射关系
$ git branch -vv muscleape f938a3d8e9 [origin/muscleape: gone] 测试test
5、查看远程分支
$ git branch -r origin/muscleape
6、查看本地各个分支目前最新的提交
$ git branch -v muscleape f938a3d8e9 测试test
7、查看远程各个分支目前最新的提交
$ git branch -r -v origin/muscleape f938a3d8e9 测试test
sequelize-cli 命令
sequelize db:migrate Run pending migrations
sequelize db:migrate:schema:timestamps:add Update migration table to have timestamps
sequelize db:migrate:status List the status of all migrations
sequelize db:migrate:undo Reverts a migration
sequelize db:migrate:undo:all Revert all migrations ran
sequelize db:seed Run specified seeder
sequelize db:seed:undo Deletes data from the database
sequelize db:seed:all Run every seeder
sequelize db:seed:undo:all Deletes data from the database
sequelize db:create Create database specified by configuration
sequelize db:drop Drop database specified by configuration
sequelize init Initializes project
sequelize init:config Initializes configuration
sequelize init:migrations Initializes migrations
sequelize init:models Initializes models
sequelize init:seeders Initializes seeders
sequelize migration:generate Generates a new migration file
[aliases: migration:create]
sequelize model:generate Generates a model and its migration
[aliases: model:create]
sequelize seed:generate Generates a new seed file [aliases: seed:create]
进入 db目录, 执行
../node_modules/.bin/sequelize --help
../node_modules/.bin/sequelize db:create 创建数据库
../node_modules/.bin/sequelize db:migrate 执行迁移
清空文件内容命令
: > echo "" > filename
: > echo > filename
: > cat /dev/null > filename
清空所有日志
echo "" > logs/*.log
清空指定文件日志
echo "" > logs/filename.log
git reset --hard id