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

    生成公钥(/c/Users/小强/.ssh/id_rsa.pub)
    ssh-keygen -t rsa -C "xxxxx@xxxxx.com"
     
    添加用户 ssh key
    在码云的设置中的ssh公钥中将id_rsa.pub中的内容拷贝到公钥中
    下载我们的项目
    git clone git@gitee.com:gewennihao/xiangmu2.git
     
    查看状态
    git status
     
    添加文件到缓存区
    git add .
     
    添加内容到分支上
    git commit -m "备注说明"
     
    初次使用时要配置下这个
    $git config --global --replace-all user.email "输入你的邮箱"
    $git config --global --replace-all user.name "输入你的用户名"
     
    添加本地数据或者是分支内容,到服务器上
    git push origin master
     
    切换到其它的分支
    git checkout develop
     
    将线上develop中的代码pull到本地
    git pull
     
     
    将远程的origin/zhou分支合并到本地的zhou分支
    git checkout -b zhou origin/zhou
     
    将develop分支合并到本地分支(在分支中合并)
    git merge develop
     
    分支操作
    git branch -a                查看远程分支     
    git branch                   查看本地分支    
    git branch develop           添加分支         
    git branch -d develop        删除分支         
    git push origin ceshi        添加远程分支     
    git push origin :ceshi       删除远程分支     
    git checkout -b gewen origin/gewen    把远程分支到本地
     
    提交步骤
    假设当前用户在irui分支上
    git add .                  添加到缓存  
    git commit -m "备注信息"    添加备注信息
    git push origin irui       添加到线上分支
    git checkout develop       切换到本地develop
    git merge irui             将irui中的数据合并到develop中
    git pull                   将线上的数据拉倒本地
    git push origin develop    提交到线上develop
    git checkout irui          切换到irui分支
    git merge develop          将develop分支的信息合并到irui分支
     
     
    1.查看Git所有配置
    git config --list
    2.删除全局配置项
    (1)终端执行命令:
    git config --global --unset user.name
    (2)编辑配置文件:
    git config --global --edit
     
     
    查看提交日志
    • git log  提交列表
    • git log –graph   点线图

    1.  使用git log命令

    git log --graph --decorate --oneline --simplify-by-decoration --all

    说明:

    --graph 点线图

    --decorate 标记会让git log显示每个commit的引用(如:分支、tag等) 

    --oneline 一行显示

    --simplify-by-decoration 只显示被branch或tag引用的commit

    --all 表示显示所有的branch,这里也可以选择,比如我指向显示分支ABC的关系,则将--all替换为branchA branchB branchC

     
     
     
  • 相关阅读:
    编写isNull isArray isFunction的方法
    JS中Null与Undefined的区别
    css中关于transform、transition、animate的区别
    js数组去重的方法
    深入理解 Javascript 面向对象编程(转)
    js 创建类和继承的几种方法
    一道面试题,想明白之后好像锤自己几下~~
    关于offsetTop offsetHeight clientHeight scrollHeight scrollTop的区别研究
    alt和title的用法区别
    C++的黑科技(深入探索C++对象模型)
  • 原文地址:https://www.cnblogs.com/cap-rq/p/10940567.html
Copyright © 2011-2022 走看看