执行
git push origin master
命令 , 将 master 分支推送到远程仓库 ;
中途会弹出输入账号密码的对话框 ,
其中 账号就是 CSDN 账号 , 密码是生成的 " 个人访问令牌 " ;
执行过程 :
D:\Git\git-learning-course>git push origin master
info: detecting host provider for 'https://codechina.csdn.net/'...
info: detecting host provider for 'https://codechina.csdn.net/'...
warning: redirecting to https://codechina.csdn.net/han12020121/git-learning-course.git/
Enumerating objects: 8, done.
Counting objects: 100% (8/8), done.
Delta compression using up to 12 threads
Compressing 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 0
remote: GitLab: http post to gitlab api /post_receive endpoint: 500 Internal Server Error
To https://codechina.csdn.net/han12020121/git-learning-course
8e848b1..c9842ef master -> master
D:\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 feature1
Auto-merging README.txt
CONFLICT (content): Merge conflict in README.txt
Automatic merge failed; fix conflicts and then commit the result.
D:\Git\git-learning-course>
D:\Git\git-learning-course>git status
On branch master
Your 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.txt
no changes added to commit (use "git add" and/or "git commit -a")
D:\Git\git-learning-course>
出现冲突的文件内容 :
<<<<<<< HEAD
master
=======
feature1
>>>>>>> feature1