zoukankan      html  css  js  c++  java
  • git基本操作

    一、分支操作
    git init
    初始化仓库
     
    git status
    查看仓库变化
     
    git add
    从工作树提交到暂存区
    git commit
    从暂存区提交到本地仓库
    git commit --amend
    修改上条记录的备注
    git commit -am 'comment'
    提交到暂存区和本地仓库
     
    git diff
    工作树和暂存区插播
    git diff HEAD
    工作树和最本地仓库的差别
     
    git checkout -- filename
    撤销工作需修改(修改、删除)
     
    git log [filename]
    查看提交日志
    git log --graph
    以图表形式查看日志
     
     
    2、分支操作
    git branch
    查看所有分支
     
    git checkout -b branchname
    创建并切换到分支branchname
     
    git checkout -
    切到上个分支
     
    git merge --no-f fbranch
    合并fbranch到当前分支
     
    git reset --hard hashvalue
    回溯到版本hashvalue
     
    git rebase -i HEAD~2
    更改log记录
     
    3、远程操作
    git remote add origin path
    添加远程仓库,将origin设置为远程仓库名称
     
    git push -u origin branchname
    将当前分支仓库推送到 远程分支branchname
     
    git pull origin branchname
    将远程分支branchname更新到当前分支
     
     
  • 相关阅读:
    要看的博客
    sleep(0)的妙用
    Spring Cloud:Eureka的多网卡IP选择问题
    SpringBoot整合swagger
    springboot整合redis(注解形式)
    RSA非对称加密
    java split(regex,limit) 使用记录
    windows git支持arc命令
    eclipse安装反编译插件
    使用@Validated分组遇到的坑
  • 原文地址:https://www.cnblogs.com/xiaoxiaocaicai/p/7532987.html
Copyright © 2011-2022 走看看