zoukankan      html  css  js  c++  java
  • git 简单使用 命令 ,最初级入门

    git download
    use git or github  ,github looks more good
    http://windows.github.com github for windows

    git 设置用户信息
    $ git config --global user.name "John Doe"
    $ git config --global user.email johndoe@example.com

    check your config  info
    git config user.name


    very good doc
    https://git-scm.com/book/zh/v2/Git-%E5%9F%BA%E7%A1%80-%E8%8E%B7%E5%8F%96-Git-%E4%BB%93%E5%BA%93


    个人本地laotop
    在现有目录中初始化仓库
    git Init
    追踪 提交
    $ git add *.c
    $ git add LICENSE
    $ git commit -m 'initial project version'

    克隆现有的仓库
    git clone https://github.com/libgit2/libgit2  mylibgit     # 自定义项目名字


    最常用的cmd
    $ git status

    跟踪新文件
    git add filename

    状态简览
    git status -s

    忽略文件
    $ cat .gitignore

    git diff
    git diff --cached


    提交更新
    git commit -m "Story 182: Fix benchmarks for speed"

    跳过使用暂存区域(Git 就会自动把所有已经跟踪过的文件暂存起来一并提交,从而跳过 git add 步骤)
    git commit -a -m 'added new benchmarks

    移除文件

    移动文件
    git mv file_from file_to

    查看提交历史
    git clone
    git log

    查看远程仓库
    git remote
    git remote -v

    添加远程仓库
    git remote add pb https://github.com/paulboone/ticgit
    git remote -v
    git fetch pb

    推送到远程仓库
    git push [remote-name] [branch-name]
    git push origin master
    当你和其他人在同一时间克隆,他们先推送到上游然后你再推送到上游,你的推送就会毫无疑问地被拒绝。 你必须先将他们的工作拉取下来并将其合并进你的工作后才能推送。

    查看远程仓库
    查看远程仓库
    git remote show [remote-name]
    git remote show origin

     Git 的杀手级特性:分支模型
     
     创建分支
     git branch testing
     
     git log 命令查看各个分支当前所指的对象
     git log --oneline --decorate
     
     分支切换
     git checkout testing
     
     切换回 master 分支看看
     git checkout master
     
     分支的新建与合并
     
     git checkout -b iss53
     ==
     git branch iss53
     git checkout iss53
     最好的方法是,在你切换分支之前,保持好一个干净的状态。
     
     在master 基础上构建一个 新的分支
     git checkout -b hotfix
     
     hotfix  合并到master  
     git checkout master
     git merge hotfix
     
     合并后 删除 hotfix  分支
     git branch -d hotfix
     
     
     遇到冲突时的分支合并
     
     
     后面还没有阅读
     https://git-scm.com/book/zh/v2/Git-%E5%88%86%E6%94%AF-%E5%88%86%E6%94%AF%E5%BC%80%E5%8F%91%E5%B7%A5%E4%BD%9C%E6%B5%81
     
     
     

     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

  • 相关阅读:
    接口自动化测试方案详解(转载)
    接口测试用例设计实践总结(转载)
    API接口测试用例编写规则(转载)
    python+requests实现接口测试
    Python3中替代Python2中cmp()函数的新函数(gt,ge,eq,le,lt)
    python write和writelines的区别
    Python2X和Python3X 除法运算符的使用:
    python 生成测试报告并发送邮件
    Python中join函数和os.path.join用法
    linux 常用命令
  • 原文地址:https://www.cnblogs.com/TendToBigData/p/10501201.html
Copyright © 2011-2022 走看看