zoukankan      html  css  js  c++  java
  • 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次提交日志



  • 相关阅读:
    分布式事务-第一刀
    Qt
    自描述C++部分面试题集
    读书笔记6.21
    STL vector容器 和deque容器
    C++ STL框架
    C++ 多态
    C++ 虚继承
    C++ 类的继承和派生
    C++ 类中的函数重载
  • 原文地址:https://www.cnblogs.com/jiangjh5/p/7199039.html
Copyright © 2011-2022 走看看