git笔记

git笔记

  • git 安装
  • git workflow

一.git安装:

  1. 参考
  2. 生成public key,private key
  3. more... or install git-client
二.git workflow:
  1. create & clone 
    create new repro       |     git init <your repro name>
    create local repro      |     git clone [--local] <file:///local-repro-dir which contains .git dir>
    create remote repro  |     git clone <remote-gitserver-repro>

  2. add or remove 
    add change to INDEX       |     git add <filename,.,*> 
    remove / delete                 |     git rm <filename,.,*>
    rename                              |     git mv <old-file-name> <new-file-name>
    ----------------------or sometime you want to ----------------------------------------
    INDEX status                    |      git status [-s] [-l]  more git status --help

  3. commit  & 同步
    commit all changes                              |     git commit -m 'message ...' 
    ---------------------------commit changes in INDEX-----------------------
    commit all changes in INDEX               |    git commit -am '...' //not use 'git add ...' command
    push changes to remote-git-server       |     git push [origin <your branch> ]
    create local repro to remote-git-server  |     git remote add origin <remote-server>
    update                              |     git pull [origin <branch>]
             
  4. branch
    create now branch                 |     git branch -b <branch-name>
    switch between branches | git switch <branch-name>
    delete | git branch -d <branch-name>
    more ... | git branch --help

  5. merge 
    merge branch                      |     git merge <source-branch> <target-branch>
    view diff between branches |     git diff      <source-branch> <target-branch>
    more...                                 |     git merge --help

  6. tagging 

    create tag                         |     git tag <tag-name> [commit-id]
    views log                          |     git log //more type 'git log --help'

  7. 本人的小整理,高手勿喷。
    参考:http://rogerdudler.github.com/git-guide/index.zh.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值