zoukankan      html  css  js  c++  java
  • GIT 相关

    git clone

    git clone --branch   克隆指定分支
    git clone --depth=1 克隆最近一次commit(减小体积)
    

    base

    git status
    git config --global core.autocrlf input		签出不转换,lf一致
    git config --global core.autocrlf true		push为lf,pull为crlf
    git config --global core.quotepath false		中文文件名乱码
    git config --list	配置项
    git branch -a 查看分支
    git reset --hard	版本退回
    git checkout -b deployv2_k8s_1.10 origin/deployv2_k8s_1.10 切换分支
    git push origin -d xxx 删除远程分支
    git pull origin xxx	更新远程分支
    git commit -m ""
    git rm --cached xxx 删除已经add的文件
    

    push code

    git checkout -b hotfix
    git branch --unset-upstream master
    git branch --set-upstream-to=hotfix
    git config --global user.email "xiongyungang@corp-ci.com"
    git config --global user.name "xiongyungang"
    git add xxx
    git commit -m ""
    git push [-f] origin hotfix
    
    git push --set-upstream origin hotfix	(2)
    

    push file or empty

    git init
    git add .
    [git rm --cached xxx]
    git commit -m ""
    git remote add origin xxx
    git push -u origin master
    

    创建远程空分支

    git checkout --orphan new_branch
    git rm -rf .  ##删除当前仓库所有文件!!!
    git add .
    git commit -m ‘new branch’
    git push origin new_branch
    

    还原git rm 删除的文件

    ## git rm -rf /src
    git reset HEAD src/
    git checkout src
    
  • 相关阅读:
    Django form
    centos 配置yum 源
    VMware clone centos 没有获取到ip
    python 自定义分页
    模态对话框
    Keepalived HAProxy mysql 配置HA
    HAProxy + mysql 配置
    mysql 配置主从
    关于python很好的网站和书籍
    【文件系统】dumpe2fs命令
  • 原文地址:https://www.cnblogs.com/xiongyungang/p/10724645.html
Copyright © 2011-2022 走看看