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

    1、提交代码流程

    git branch -va

    git checkout release

    git pull

    git status

    git add pom.xml / git add *

    git commit -m “TAPD ID:278”

    git push

     

    git 删除远程分支

    git push origin :branch-name

    冒号前面的空格不能少,原理是把一个空分支push到server上,相当于删除该分支。

    git push origin :upgrade_redis_util

     

    git 删除本地分支

    git branch -d xxxxx

     

    git 删除撤销commit

    git reset - -hard commit_id  代码也会回退回去

    git reset - -soft commit_id  代码不会回退回去,只会退commit_id

     

    git checkout . #本地所有修改的。没有的提交的,都返回到原来的状态

    git stash #把所有没有提交的修改暂存到stash里面。可用git stash pop恢复。

     

    git commit - -amend 修改commit 注释

     

    mvn install -Dmaven.test.skip=true  maven编译时跳过对Test部分的编译。

     

    git revert 撤销 某次操作,此次操作之前和之后的commit和history都会保留,并且把这次撤销作为一次最新的提交

     

    git format-patch 1ebbbfaa89202b2025f4113715b345eabd988624..dab5bf0118e9d096c129cc0084e49a985f97da7a

    git reset --hard 3129f73d271210aac490e5066a75932e28c5a12c

    git am 0001-RM-ID-4630.patch

    git push -f

     

     

    git stash apply stash@{1}

     

    history 查看命令历史

    eg:

    wenyunlideMacBook-Air:biz-oa-contract-web wenyunli$ history

       63  git add .

       64  git commit -m "RM ID:16187"

       65  git push

       66  git status

       67  git add .

       68  git commit -m "RM ID:16187"

       69  git puhs

       70  git push

       71  cd code/sql/mysql_db_scripts/

       72  git pull

       73  open .

       74  clear

     

    !74 执行74那条命令 

    wenyunlideMacBook-Air:biz-oa-contract-web wenyunli$ !532

    pwd

    /Users/wenyunli/code/biz-oa-contract-web

  • 相关阅读:
    LINQ语句中的.AsEnumerable() 和 .AsQueryable()的区别
    Linq扩展方法之All 、Any
    Linq扩展方法之Aggregate 对序列应用累加器函数
    C#开发的进化史
    C#选择文件、选择文件夹、打开文件(或者文件夹)
    XPath操作XML文档
    文档对象模型操作xml文档
    XML简介
    php获取某经纬度附近地点位置
    Yii中实例化类的四种方式
  • 原文地址:https://www.cnblogs.com/-wyl/p/7640804.html
Copyright © 2011-2022 走看看