git常用命令

创建并切换至新分支panda

zizhoutongdeMacBook-Pro:foredemo zizhoutong$ git checkout -b panda
M       .gitignore
M       package.json
M       src/App.js
M       src/Details.js
M       src/Query.js
M       src/css/index.css
Switched to a new branch 'panda'

上传到暂缓区

zizhoutongdeMacBook-Pro:foredemo zizhoutong$ git add .

提交,附加说明

zizhoutongdeMacBook-Pro:foredemo zizhoutong$ git commit -m '增加了查询api'
[panda 45b194a] 增加了查询api
 10 files changed, 355 insertions(+), 215 deletions(-)
 create mode 100644 mock/data.json
 rewrite src/Details.js (71%)
 create mode 100644 src/pic/detail.png
 create mode 100644 src/pic/header.png
 create mode 100644 src/pic/query.png
 create mode 100644 src/pic/show.png
 create mode 100644 src/test.js

推送到远程分支仓库

zizhoutongdeMacBook-Pro:foredemo zizhoutong$ git push origin panda
Enumerating objects: 37, done.
Counting objects: 100% (37/37), done.
Delta compression using up to 4 threads
Compressing objects: 100% (32/32), done.
Writing objects: 100% (37/37), 426.74 KiB | 11.23 MiB/s, done.
Total 37 (delta 6), reused 0 (delta 0)
remote: 
remote: To create a merge request for panda, visit:
remote:   http://gitlab.iwhalecloud.com/grampus/demo/merge_requests/new?merge_request%5Bsource_branch%5D=panda
remote: 
To gitlab.iwhalecloud.com:grampus/demo.git
 * [new branch]      panda -> panda
zizhoutongdeMacBook-Pro:foredemo zizhoutong$ git branch
  master
* panda

切换到主分支

zizhoutongdeMacBook-Pro:foredemo zizhoutong$ git checkout master
Switched to branch 'master'

在合并后删除panda分支

zizhoutongdeMacBook-Pro:foredemo zizhoutong$ git push origin -d panda
To gitlab.iwhalecloud.com:grampus/demo.git
 - [deleted]         panda

你可能感兴趣的:(git常用命令)