文章目录
一、推送主版本和分支版本到远程仓库二、合并分支出现文件冲突一、推送主版本和分支版本到远程仓库
执行
git push origin master
命令 , 将 master 分支推送到远程仓库 ;
中途会弹出输入账号密码的对话框 ,
其中 账号就是 CSDN 账号 , 密码是生成的 " 个人访问令牌 " ;
执行过程 :
D:\Git\git-learning-course>git push origin masterinfo: detecting host provider for '/'...info: detecting host provider for '/'...warning: redirecting to /han1201/git-learning-course.git/Enumerating objects: 8, done.Counting objects: 100% (8/8), done.Delta compression using up to 12 threadsCompressing objects: 100% (4/4), done.Writing objects: 100% (6/6), 639 bytes | 213.00 KiB/s, done.Total 6 (delta 0), reused 0 (delta 0), pack-reused 0remote: GitLab: http post to gitlab api /post_receive endpoint: 500 Internal Server ErrorTo /han1201/git-learning-course8e848b1..c9842ef master -> masterD:\Git\git-learning-course>
执行
git push origin feature1
命令 , 将 feature1 分支推送到远程仓库 ;
二、合并分支出现文件冲突
执行
git switch master
命令 , 切换到 master 主版本分支 ;
然后执行
git merge feature1
命令 , 将 master 分支和 feature1 分支 进行合并 ; 然后执行
git status
命令 , 查看合并后的状态 , 是否有冲突 ;
执行过程 :
D:\Git\git-learning-course>git merge feature1Auto-merging README.txtCONFLICT (content): Merge conflict in README.txtAutomatic merge failed; fix conflicts and then commit the result.D:\Git\git-learning-course>D:\Git\git-learning-course>git statusOn branch masterYour branch is up to date with 'origin/master'.You have unmerged paths.(fix conflicts and run "git commit")(use "git merge --abort" to abort the merge)Unmerged paths:(use "git add <file>..." to mark resolution)both modified: README.txtno changes added to commit (use "git add" and/or "git commit -a")D:\Git\git-learning-course>
出现冲突的文件内容 :
<<<<<<< HEADmaster=======feature1>>>>>>> feature1
【Git】Git 分支管理 ( 解决分支合并冲突 | 推送主版本和分支版本到远程仓库 | 合并分支出现文件冲突 )
如果觉得《【Git】Git 分支管理 ( 解决分支合并冲突 | 推送主版本和分支版本到远程仓库 |》对你有帮助,请点赞、收藏,并留下你的观点哦!