天玑阁

vuePress-theme-reco gqsu    2018 - 2021
天玑阁 天玑阁

Choose mode

  • dark
  • auto
  • light
主页
时间轴
文档
  • vuepress-reco
分类
  • elasticsearch
  • Hadoop
  • life
  • linux
  • note
  • Apache James
  • collection
  • Dubbo
  • git
  • jwt
  • k8s
  • mongodb
  • ali
  • netty-socketio
  • nginx
  • node
  • oracle
  • own
  • rabbitmq
  • shell
  • vuepress
  • springDataJpa
  • web
  • wechat
  • redis
  • springBoot
  • rabbitmq,springBoot
  • springCloud
  • sql
  • study
  • util
标签
author-avatar

gqsu

156

Article

42

Tag

    主页
    时间轴
    文档
    • vuepress-reco
    分类
    • elasticsearch
    • Hadoop
    • life
    • linux
    • note
    • Apache James
    • collection
    • Dubbo
    • git
    • jwt
    • k8s
    • mongodb
    • ali
    • netty-socketio
    • nginx
    • node
    • oracle
    • own
    • rabbitmq
    • shell
    • vuepress
    • springDataJpa
    • web
    • wechat
    • redis
    • springBoot
    • rabbitmq,springBoot
    • springCloud
    • sql
    • study
    • util
    标签

    git Categories

    vuePress-theme-reco gqsu    2018 - 2021
    • elasticsearch 20
    • Hadoop 2
    • life 6
    • linux 9
    • note 9
    • Apache James 2
    • collection 1
    • Dubbo 1
    • git 1
    • jwt 1
    • k8s 1
    • mongodb 1
    • ali 2
    • netty-socketio 2
    • nginx 2
    • node 3
    • oracle 1
    • own 1
    • rabbitmq 2
    • shell 1
    • vuepress 1
    • springDataJpa 1
    • web 2
    • wechat 2
    • redis 6
    • springBoot 27
    • rabbitmq,springBoot 1
    • springCloud 13
    • sql 6
    • study 24
    • util 5
    Git的基本使用

    git中最重要的四个点:工作区、暂存区、本地仓库和远程仓库

    工作区---(git add)---->暂存区----(git commit)----> 本地仓库 -----(git push)----> 远程仓库

    # git基本操作

    • $ git init [project-name]: 初始化一个Git仓库
    • $ git remote add origin https://github.com/suguoqiang/hexo.git:添加一个origin变量代替url地址
    • $ git clone [url]: 下载远程仓库的项目到本地
    • $ git add <file>: 添加文件到暂存区,可反复使用。.代表当前路径下所有文件
    • $ git rm <file>: 删除工作区的某一个文件,并将其放入暂存区
    • $ git commit [file1] [file2] -m <message>:提交暂存区的文件到仓库区
    • $ git status:查看当前仓库状态
    • $ git diff <file>:查看文件异同,如:git diff HEAD -- readme.txt
    • $ git log:查看最近到最远的提交日志。可选简化的参数:--pretty=oneline
    • $ git remote -v :详细远程库的信息
    • $ git commit --amend: 修改上次的提交内容,一般指注释(修改没有 push 之前的提交)
    • $ git commit --amend --no-edit: 追加新的内容到上次没有 push 的提交
    gqsu 2018/2/9上午9:12:47 git
    Prev 1 ... 1 ... 1 Next Jump To Go