git流程

1.开始创业

git init
git status
git add .
git commit -m 'v1.0'
git log

2.事业上升

git add .
git commit -m 'v2.0'
git add .
git commit -m 'v3.0'

3.遇到波折

git log
git reset --hard xxxxxxx(v2版本号)

4.解决挫折

git reflog
git reset --hard xxxxxxx(v3版本号)

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-CSZkCfuS-1604821631358)(/Users/mac/Desktop/截屏2020-10-18 下午10.03.52.png)]

5.开发途中遇到bug

  1. 开发新功能

    git branch dev
    git checkout dev
    dit add .
    git commit -m '开发50%'
    
  2. 遇到bug

    git branch bug
    git checkout bug
    git add .
    git commit -m '修复完bug'
    git checkout master
    git merge bug
    git branch -d bug
    
  3. 继续开发

git checkout dev
git git add . 
git commit -m '开发100%'
git checkout master
git merge dev //此处要解决冲突
git branch -d dev

6.公司扩张

git remote add origin xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
git push -u origin master/git push dev
git clone xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

7.来回上下班

git pull origin dev

git push origin dev

git checkout master

git merge dev

git pull -u origin master

8.变基整合

1.rebase

git rebase -i xxxxxxxxx // 整合head->xxxxxxxx
git rebase -i head~3//整合head前三
ps:不要rebase已经提交到远程仓库的版本

2.log

git log --graph
git log --graph --pretty=fromat:"%h %s"

9.打标签

git tag -a 'v1' -m '第一版'
git push origin --tag

10.免密登录

  • 在url中

    https://name:password@github.com
    
  • ssh

  • Git自动管理凭证

git 强制覆盖本地代码

git fetch --all
git reset --hard origin/master
git pull

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值