新建分支dxj,然后把分支dxj写的代码合并到master中并push到远程仓库github中,步骤如下:
1.在当前主分支master中新建分支dxj
E:\projects\ERP\zyyerp-front>git branch dxj
讯享网
2.在master中切换到分支dxj
讯享网E:\projects\ERP\zyyerp-front>git checkout dxj Switched to branch 'dxj' Your branch is up to date with 'origin/dxj'.
3.查看当前分支,命令:git branch 。带有星号的就是当前使用的分支。然后dxj编写自己负责的代码。
E:\projects\ERP\zyyerp-front>git branch * dxj master
4.添加所有修改代码至暂存区(local cache),命令git add -A
讯享网E:\projects\ERP\zyyerp-front>git add -A
5.快捷提交至本地仓库(local repository) ,命令:git commit -am ‘这里是这次提交写的评论’
E:\projects\ERP\zyyerp-front>git commit -am '开始主页布局' [dxj 088e3e9] '开始主页布局' 1 file changed, 23 insertions(+), 3 deletions(-)
6.把分支dxj合并到master之前先要切换分支到mster,切换分支命令:git checkout branchName
讯享网E:\projects\ERP\zyyerp-front>git checkout master Switched to branch 'master' Your branch is up to date with 'origin/master'.
查看是否切换成功
E:\projects\ERP\zyyerp-front>git branch dxj * master
7.把分支dxj写的代码合并到master中,命令:git merge mergeTarget
讯享网E:\projects\ERP\zyyerp-front>git merge dxj Updating 3c89c9d..088e3e9 Fast-forward src/components/Home.vue | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-)
8.主分支master最新代码推送到远程仓库(remote git repository) ,命令:git push
E:\projects\ERP\zyyerp-front>git push Enumerating objects: 9, done. Counting objects: 100% (9/9), done. Delta compression using up to 8 threads Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 902 bytes | 902.00 KiB/s, done. Total 5 (delta 2), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (2/2), completed with 2 local objects. To https://github.com/cn-hyf/zyyerp-front.git 3c89c9d..088e3e9 master -> master
9.查看树状态,nothing to commit, working tree clean表示当前修改的代码都同步到远程仓库了。
讯享网E:\projects\ERP\zyyerp-front>git status On branch master Your branch is up to date with 'origin/master'. nothing to commit, working tree clean
E:\projects\ERP\zyyerp-front>git checkout dxj Switched to branch 'dxj'
10.2 把分支dxj写的代码推送到远程仓库github中,命令git push -u origin dxj
讯享网E:\projects\ERP\zyyerp-front>git push -u origin dxj Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 remote: remote: Create a pull request for 'dxj' on GitHub by visiting: remote: https://github.com/cn-hyf/zyyerp-front/pull/new/dxj remote: To https://github.com/cn-hyf/zyyerp-front.git * [new branch] dxj -> dxj Branch 'dxj' set up to track remote branch 'dxj' from 'origin'.
10.3 查看树状态
E:\projects\ERP\zyyerp-front>git status On branch dxj Your branch is up to date with 'origin/dxj'. nothing to commit, working tree clean

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/65040.html