(记录)一些简单的git操作

创建分支 git branch ***

 

切换分支 git checkout ***

 

创建并切换到新分支 git checkout -b ***

 

删除分支 git branch -d ***

 

本地分支关联远程分支 git branch --set-upstream-to=origin/remote_branch  your_branch

 

添加文件至暂存区 git add

 

提交暂存区文件 git commit -m "description"

以上两部操作可合并为 git commit -am "description"

 

pull:git pull origin remote_branch:your_branch

 

push:git push origin your_branch:remote_branch

 

查看该分支所有操作(commit push pull...) git reflog

 

回滚至某个版本:先使用git reflog查询某个版本的版本号,eg:e1bdff6 (HEAD -> master) HEAD@{0}: commit: description,然后git reset --hard e1bdff6

 

创建一个指定某个远程分支的本地分支 git checkout -b new_branch origin/remote_branch

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值