标签:laravel Git app qa merge git push lesson php
D:\laragon\www\laravel-qa>git branch
* master
D:\laragon\www\laravel-qa>git checkout -b lesson-2
Switched to a new branch 'lesson-2'
D:\laragon\www\laravel-qa>git status On branch lesson-2 Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: app/User.php Untracked files: (use "git add <file>..." to include in what will be committed) app/Http/Controllers/QuestionController.php app/Models/ database/factories/QuestionFactory.php database/migrations/2020_05_09_192154_create_questions_table.php no changes added to commit (use "git add" and/or "git commit -a") D:\laragon\www\laravel-qa>git add -A warning: LF will be replaced by CRLF in app/User.php. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in app/Http/Controllers/QuestionController.php. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in app/Models/Question.php. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in database/factories/QuestionFactory.php. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in database/migrations/2020_05_09_192154_create_questions_table.php. The file will have its original line endings in your working directory D:\laragon\www\laravel-qa>git commit -m "generate question model via artisan model generator" [lesson-2 1851bad] generate question model via artisan model generator 5 files changed, 174 insertions(+) create mode 100644 app/Http/Controllers/QuestionController.php create mode 100644 app/Models/Question.php create mode 100644 database/factories/QuestionFactory.php create mode 100644 database/migrations/2020_05_09_192154_create_questions_table.php D:\laragon\www\laravel-qa>git push -u origin lesson-2 Enumerating objects: 22, done. Counting objects: 100% (22/22), done. Delta compression using up to 6 threads Compressing objects: 100% (13/13), done. Writing objects: 100% (14/14), 2.51 KiB | 367.00 KiB/s, done. Total 14 (delta 4), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (4/4), completed with 4 local objects. remote: remote: Create a pull request for 'lesson-2' on GitHub by visiting: remote: https://github.com/dzkjz/laravel-qa/pull/new/lesson-2 remote: To https://github.com/dzkjz/laravel-qa.git * [new branch] lesson-2 -> lesson-2 Branch 'lesson-2' set up to track remote branch 'lesson-2' from 'origin'. D:\laragon\www\laravel-qa>git checkout master Switched to branch 'master' Your branch is up to date with 'origin/master'. D:\laragon\www\laravel-qa>git merge lesson-2 Updating ad06dbf..1851bad Fast-forward app/Http/Controllers/QuestionController.php | 85 ++++++++++++++++++++++ app/Models/Question.php | 24 ++++++ app/User.php | 8 ++ database/factories/QuestionFactory.php | 12 +++ .../2020_05_09_192154_create_questions_table.php | 45 ++++++++++++ 5 files changed, 174 insertions(+) create mode 100644 app/Http/Controllers/QuestionController.php create mode 100644 app/Models/Question.php create mode 100644 database/factories/QuestionFactory.php create mode 100644 database/migrations/2020_05_09_192154_create_questions_table.php D:\laragon\www\laravel-qa>git push -u origin master Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 To https://github.com/dzkjz/laravel-qa.git ad06dbf..1851bad master -> master Branch 'master' set up to track remote branch 'master' from 'origin'. D:\laragon\www\laravel-qa>
git checkout –b lesson-2
执行后
之后的编辑结果都在该分支
当执行git checkout master切换到主节点后,会发现修改的代码或新增的文件都消失了,但是
执行 git merge lesson-2之后,就会将lesson-2的修改结果融合到主分支,lesson-2修改的代码或新增的文件就又都回来了。
标签:laravel,Git,app,qa,merge,git,push,lesson,php 来源: https://www.cnblogs.com/dzkjz/p/12863065.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。