zoukankan      html  css  js  c++  java
  • Git常用命令

    1、 git clean(删除未监视文件untracked files

    git clean -f  # 删除 untracked files
    git clean -fd  # 连 untracked 的目录也一起删掉
    git clean -xfd   # 连 gitignore 的untrack 文件/目录也一起删掉 (慎用,一般这个是用来删掉编译出来的 .o之类的文件用的)
     
    # 在用上述 git clean 前,墙裂建议加上 -n 参数来先看看会删掉哪些文件,防止重要文件被误删
    git clean -nxfd
    git clean -nf
    git clean -nfd
    2、其它常用命令
     

    git status .  // 显示当前改动
    git rm -r 文件夹  //删除文件夹
    git commit .  // 提交

    git push .  // 推送至服务器

    git remote show origin  //查看远程仓库地址

    git remote set-url origin newUrl //切换远程仓库地址

    git reset --hard cd811d2  //还原到版本cd811d2

    3、版本切换

      git checkout cd811d2  //切到特定版本

      git switch -  //切到最新版本

  • 相关阅读:
    关于H5中的Canvas API的探索
    leetcode297 Serialize and Deserialize Binary Tree
    CF1187E Tree Painting
    CF1187D Subarray Sorting
    CF1183E/H Subsequences
    kickstart2019 round_C B. Circuit Board
    leetcode85 Maximal Rectangle
    leetcode84 Largest Rectangle in Histogram
    kickstart2019 round_A B. Parcels
    蓝桥杯 正则问题
  • 原文地址:https://www.cnblogs.com/wujinhong/p/10291806.html
Copyright © 2011-2022 走看看