帝王谷资源网 Design By www.wdxyy.com
1. 查看远程分支
git branch -r origin/master
2. 查看本地分支
git branch *master
注:以*开头指明现在所在的本地分支
3. 查看本地分支和远程分支
git branch -a *master remotes/origin/master
4. 创建分支
*新建一个分支,但依然停留在当前分支
git branch [branch-name]
*新建一个分支,并切换到该分支上
git branch -b [branch-name]
4-1 创建本地分支
$ git branch test_1 $ git branch -a * master test_1 remotes/origin/master
注:创建本地分支时,默认是把所在的本地分支的东西拷贝给新建本地的分支。
4-2 把本地分支推送到远端作为远端分支
$ git push origin test_1 To git@****** * [new branch] test_1 -> test_1 $ git branch -a * master test_1 remotes/origin/master remotes/origin/test_1
注:git push origin test_1会把本地的test_1分支推送到远端,本地test_1分支和远端的对应关系是test_1-->test_1
如果本地根本没有分支test_9,推送的话会提示错误
5. 切换到分支
$ git checkout test_1 Switched to branch 'test_1'
6. 删除本地分支
$ git branch -a master test_1 test_2 remotes/origin/master remotes/origin/test_1 remotes/origin/test_2 $ git branch -d test_2 Deleted branch test_2 (was c470057). $git branch -a master test_1 remotes/origin/master remotes/origin/test_1 remotes/origin/test_2
可以看到本地分支test_2删除了
7. 删除远程分支
复制代码 $ git branch -a * master test_1 remotes/origin/master remotes/origin/test_1 remotes/origin/test_2 $ git push origin :test_2 To git@*********- [deleted] test_2 $ git branch -a * master test_1 remotes/origin/master remotes/origin/test_1
注:git push origin :*** 就是删除远程分支的意思,和刚才我删除本地无关。如下面,我留着本地test_1分支,只是删除了远端的分支test_1
$ git push origin :test_1 To git@******** - [deleted] test_1 $ git branch -a * master test_1 remotes/origin/master
更多关于git命令的使用方法与实例请查看下面的相关链接
帝王谷资源网 Design By www.wdxyy.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
帝王谷资源网 Design By www.wdxyy.com
暂无评论...
更新日志
2024年10月25日
2024年10月25日
- 群星2013-青春缤纷辑压箱宝大公开3CD2[新加坡限量版][WAV整轨]
- 林育群.2013-BalladShow(日本版)【环球】【WAV+CUE】
- 陈加洛.1992-痛到感觉不到【宝丽金】【WAV+CUE】
- 群星.2023-宿命之敌电视剧原声带【韶愔音乐】【FLAC分轨】
- 東京事変-大発見[FLAC+CUE]
- 椎名林檎-三文ゴシップ[FLAC+CUE]
- 2024年08月04日
- 裘德《裘德「最后的水族馆」演唱会LIVE》[320K/MP3][228.89MB]
- 裘德《裘德「最后的水族馆」演唱会LIVE》[24bit 48kHz][FLAC/分轨][2.08G]
- 基因三重奏《如果你什么都不说 音乐会现场录音》[320K/MP3][145.37MB]
- 孟庭苇.1996-月亮说话(2020环球24KGOLD限量版)【上华】【WAV+CUE】
- 群星.1997-新艺宝优质音响系列·国语精选监听版【新艺宝】【WAV+CUE】
- 阿桑.2005-寂寞在唱歌(星外星引进版)【华研国际】【WAV+CUE】
- 基因三重奏《如果你什么都不说 音乐会现场录音》[FLAC/分轨][287.43MB]
- 蔡题谦《我爱你,却依然要看你走》[320K/MP3][88.65MB]