Git-查看远程分支、本地分支、创建分支

更新时间:2023-06-15 07:20:25 阅读: 评论:0

Git-查看远程分⽀、本地分⽀、创建分⽀
1.查看本地分⽀
disneyland
$ git branchhilton
* br-2.1.2.2
master
2.查看远程分⽀
$ git branch -r
origin/HEAD -> origin/master
origin/feature/IOS_visualtrack
origin/feature/android_visualtrack
origin/master
苹果手机锁屏时间
3.查看所有分⽀
$ git branch -a
* br-2.1.2.2千头万绪的意思
联想官方客服电话master
remotes/origin/HEAD -> origin/master
remotes/origin/br-2.1.2.1
remotes/origin/br-2.1.2.2
remotes/origin/br-2.1.3
remotes/origin/master
4.切换远程分⽀
$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/Relea
remotes/origin/master
$ git checkout -b myRelea origin/Relea
Branch myRelea t up to track remote branch Relea from origin.
Switched to a new branch 'myRelea'
PS:作⽤是checkout远程的Relea分⽀,在本地起名为myRelea分⽀,并切换到本地的myRela分⽀
5.合并分⽀
硫分合并前要先切回要并⼊的分⽀
以下表⽰要把issue1234分⽀合并⼊master分⽀
$: git checkout master
$: git merge issue1234
Merge made by recursive.
README |    1 +
1 files changed, 1 inrtions(+), 0 deletions(-)
6.撤消上⼀次commit的内容(该操作会彻底回退到某个版本,本地的源码也会变为上⼀个版本的内容)
git ret --hard <commit-id>
以下表⽰要撤消“update build gradle configuration file”这⼀次的commit id,返回到"add battery ttings ui"这⼀次的commit id, xp.chen@YC-JG-YXKF-PC27 MINGW64 /f/ob (())
$ git log
commit c8303a9e8db2bcf4edb7488e722a380f4e8858ec (HEAD)
Author: xp.chen <xp.>
Date:  Sat Oct 2809:28:512017 +0800
update build gradle configuration file
Change-Id: I9ee532fd0d4698613698a64eb754fb98a8559e32
commit 8d8e5ccf24cf6836ab780aa3860270c3876e825a
Author: xp.chen <xp.>
Date:  Sat Oct 2809:02:012017 +0800
add battery ttigns ui
Change-Id: Ia907ee4e84f54c00a186d31378a7925a6adaba0e
xp.chen@YC-JG-YXKF-PC27 MINGW64 /f/ob (())
$ git ret --hard 8d8e5ccf24cf6836ab780aa3860270c3876e825a HEAD is now at 8d8e5cc add battery ttigns ui
xp.chen@YC-JG-YXKF-PC27 MINGW64 /f/ob (())
$ git log
commit 8d8e5ccf24cf6836ab780aa3860270c3876e825a (HEAD) Author: xp.chen <xp.>
Date:  Sat Oct 2809:02:012017 +0800
add battery ttigns ui
Change-Id: Ia907ee4e84f54c00a186d31378a7925a6adaba0e
7. git commit -m 注释换⾏
git commit -m 注释可以通过单引号来换⾏,⽐如:
$ git commit -m '
> 1.aaaaa
> 2.bbbb
> '
山茶花的寓意
[master b25154b] 1.aaaaa 2.bbbb
1file changed, 0 inrtions(+), 0 deletions(-)
骨头汤的做法大全
create mode
通过git commit --amend 命令可以查看到刚刚的log信息为
1.aaaaa
2.bbbb

本文发布于:2023-06-15 07:20:25,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1039283.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:版本   合并   远程
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图