git学习使用游戏小笔记

git学习使用游戏小笔记

联系网站:Git 学习在线教学

git闯关小游戏
1.与远程库连接

git remote -v  //查看远端库
git remote add origin https://github.com/XuedongWu/TYcamera_Dirver.git   //连接远端库
// origin 为默认远端库的名称,可自行定义远端库
// 删除远程库
git remote remove name_reposity

2.新建本地分支,推送到远端库

git branch new-branch-name
git checkout new-branch-name
//上面的两条指令可以合并成一条
git checkout -b new-branch-name
git add . 
git commit -m "message"
git push origin new-branch-name

3.强制上传

git push origin +master

4.返回以前版本

git reset --hard HEAD
// 这是取消的 git status 中的更改,
git reset --hard HEAD^
// 返回上个commit的版本
git reset --hard HEAD~Num

5.新建分支,以及指定commit

git branch new-branch
// 新建分支名字
git branch new-branch commit id
// 新建分支 并指定版本

6. 合并分支

  • 法一:get merge
git merge other-branch aim-branch
  • 法二:git rebase
git rebase 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值