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次提交日志



  • 相关阅读:
    转:python时间日期处理小结
    vi 的一些常用操作-君子善假于物也
    没有了老师,该如何学习?
    git常用命令
    python 读配置文件
    Python中unittest用法实例
    python 单元测试unnitest-摘录自http://www.cnblogs.com/hackerain/p/3682019.html#undefined
    纯CSS实现立方体旋转
    CSS 3动画
    CSS 2D转换
  • 原文地址:https://www.cnblogs.com/jiangjh5/p/7199039.html
Copyright © 2011-2022 走看看