• git 简单命令


    使用git config指令查询代理并取消代理

    • 设置全局代理git config --global http.proxy https://gitlab.gwlocal.com

    • git config --global http.proxy # 显示已有的https代理信息:
      https://gitlab.gwlocal.com

    • 取消全局代理:git config --global --unset http.proxy

    • 设置局部代理git config --local remote.origin.proxy http://192.168.1.67:88

    • git config --local remote.origin.proxy

    • git config --local --unset remote.origin.proxy

    git stash命令使用

    如果你学会 stash,就不用那么狼狈了。你只需要:

    git stash  
    
    • 1

    就这么简单,代码就被存起来了。

    当你修复完线上问题,切回 feature 分支,想恢复代码也只需要:

    git stash apply  
    
    • 1

    相关命令

    # 保存当前未commit的代码  
    git stash  
      
    # 保存当前未commit的代码并添加备注  
    git stash save "备注的内容"  
      
    # 列出stash的所有记录  
    git stash list  
      
    # 删除stash的所有记录  
    git stash clear  
      
    # 应用最近一次的stash  
    git stash apply  
      
    # 应用最近一次的stash,随后删除该记录  
    git stash pop  
      
    # 删除最近的一次stash  
    git stash drop  
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20

    当有多条 stash,可以指定操作stash,首先使用stash list 列出所有记录:

    $ git stash list  
    stash@{0}: WIP on ...  
    stash@{1}: WIP on ...  
    stash@{2}: On ...  
    
    • 1
    • 2
    • 3
    • 4

    应用第二条记录:

    $ git stash apply stash@{1}  
    
    • 1

    pop,drop 同理。

  • 相关阅读:
    Oracle + MyBatis 批量更新 update
    LRUMAP 原理解析
    HarmonyOS学习——HarmonyOS习题
    【Android】实验二 Android GUI开发
    Pandas:如何让你的代码性能飙升
    opencv中边缘检测的方法
    Ubuntu修改下载源
    Linux C++ 实现一个简易版的ping (也就是ICMP协议)
    Matlab2022b软件如何切换中/英文界面?
    【数据结构】二叉树
  • 原文地址:https://blog.csdn.net/qikaihuting/article/details/87883565