• Git-常用命令


    // creat 数字签名
    # ssh-keygen -t rsa
    
    # git config --global user.name "Your Name"
    # git config --global user.email "Your Email"
    # git config --global push.default [simple|matching]
    
    // 详细说明
    # git remote    // 查看远程主机
    # git remote -v
    # git remote add [主机名] [网址]
    # git remote show [主机名]
    # git remote rm [主机名]
    # git remote rename [原主机名] [新主机名]
    
    // 基本操作
    # git remote add origin git@git.oschina.net:qingfeng/Kuaidi.git
    # git branch --set-upstream-to=origin/master
    
    # git pull origin master
    # git push -u origin master
    
    # git status
    
    # git checkout -b newBranch origin/master // 创建并切换分支
    
    # git branch [newBranch] // 创建分支 
    # git branch -a
    # git branch -v // 查看各个分支的最后一次提交
    # git branch -merged // 查看哪些分支合并到当前分支
    # git branch -no-merged // 查看哪些分支未合并到当前分支
    # git branch -d // 删除分支
    # git branch -D // 强制删除分支
    
    # git merge [branchName] // 合并分支
    # git rebase [branchName] // 更新[branchName]的东西到当前分支
    
    # git add <file>
    # git add <folder>
    # git add --all <file>|<folder>
    # git rm [filename]
    # git rm -r -f [foldername]
    # git commit -m "init&add"
    
    # git init
    # git checkout --orphan [branchname]
    
    # git remote -v
    
    # git config core.autocrlf false // CR LF问题

     # git checkout -- [filename] // 撤回到最近一个commit或者add
     # git reset --hard [commit-id] // 回滚到指定的提交id
     # git reset --hard HEAD~3 // 回滚最近3次的提交
     # git log -2 // 查看最近2次提交日志



  • 相关阅读:
    几个关于设计的小问题
    基于建立/保持时间等的参数化时序分析
    Stratix内嵌存储器测试报告
    采用流水线技术实现8位加法器
    运算顺序引发的一系列有趣问题
    PON系统基础知识简介
    某MDU产品OMCI软件升级加速方案
    研究生期间接受的指导(二)
    研究生期间接受的指导(一)
    1063 Set Similarity (25 分)
  • 原文地址:https://www.cnblogs.com/jiangjh5/p/7199039.html
Copyright © 2020-2023  润新知