Git分支创建、合并、上传等命令
生活随笔
收集整理的這篇文章主要介紹了
Git分支创建、合并、上传等命令
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Git分支創(chuàng)建、合并、上傳等命令
一、 創(chuàng)建test分支提交步驟
1.列出所有分支
git branch -a
2.創(chuàng)建test分支
git branch test
3.切換到test分支:
git checkout test
4.添加add修改:
git add .
5.添加commit注釋
git commit -m “第一次提交代碼”
6.提交到服務(wù)器
git push origin test
二、將test分支合并到master本地分支
1.創(chuàng)建test分支
git branch test
2.切換到test分支
git checkout test
3.在test分支添加一個(gè)readme.txt文件
touch readme.txt
git add readme.txt
4.提交commit本地文件
git commit -m “增加readme.txt”
5.切換到master分支
git checkout master
6.把test分支合并到master分支
git merge test
7.提交master分支到服務(wù)器
git push origin master
8.刪除test分支
git branch -d test
總結(jié)
以上是生活随笔為你收集整理的Git分支创建、合并、上传等命令的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 大事件后台管理系统开发实战(上)
- 下一篇: 小程序开发(13)-location定位