zoukankan      html  css  js  c++  java
  • Git命令

    Git分支

    分支基本操作

    分支创建

    git branch fenzhi
    

    查看所有分支

    git branch
    

    分支切换

     git checkout fenzhi
    

    合并分支

    • 合并如果有冲突,需要手动去处理,处理后还需要再提交一次。

    当前分支和指定分支(fenzhi)合并

    git merge fenzhi
    

    查看状态

    git status
    

    查看Commit操作历史

    git log --online
    

    回退到指定版本

    • git reset --hard Head~0
      
      • 标识回退到上一次代码提交时的状态
    • git reset --hard Head~1
      
      • 标识回退到上上次代码提交时的状态
    • git reset --hart [版本号]
      
      • 可以通过版本号精确的回退到某一次提交的状态
    • git reflog
      
      • 可以看到每一次切换版本的记录:可以看到所有提交的版本号

    查看分支对象

    git log --oneline --decorate
    

    项目分叉历史

    $ git log --oneline --decorate --graph --all
    * c2b9e (HEAD, master) made other changes
    | * 87ab2 (testing) made a change
    |/
    * f30ab add feature #32 - ability to add new formats to the
    * 34ac2 fixed bug #1328 - stack overflow under certain conditions
    * 98ca9 initial commit of my project
    
    

    Github

    提交代码

    git push 地址 master
    

    克隆代码

    git pull 地址 master
    
    • 会把远程分支数据得到:(注意本地要初始化一个仓库
    • git clone 地址
    • 会得到远程仓库形同的数据多次执行会覆盖本地

    模拟两个用户

    git init
    修改
    git add
    git commit
    git push
    

    冲突后会提示,手动修改重新提交

    先add 再commit然后pull的时候会自动合并,手动修改。

  • 相关阅读:
    MySQL用户权限管理
    索引 聚集索引 唯一索引 普通索引 联合索引 覆盖索引
    sql注入
    pymysql
    MySQL 多表查询
    MySQL 聚合函数以及 优先级
    mysql 语句 字段 和结构主键外键的增删改
    协程
    事件 event
    进程池和线程池 concurrent.futures import ProcessPoolExecutor,ThreadPoolExecutor
  • 原文地址:https://www.cnblogs.com/liushiqiang123/p/13886189.html
Copyright © 2011-2022 走看看