zoukankan      html  css  js  c++  java
  • git 回滚到上个版本命令以及忽略某些文件提交

      1.git回滚到上个版本

    git reset --hard FETCH_HEAD

    2.git忽略某些文件的提交

     以前是用默认的.gitignore 然后再里面默认某些文件不提交。但是有个问题,.gitignore忽略不掉。因为这是一个全局的。可以改为这样子:

       找到 隐藏的.git文件夹,在里面编辑.git/info/exclude文件(如果没有info则创建,默认是没有的),把要忽略的给编辑到exclude里面。

      语法与.gitignore一致。两个文件区别在于,exclude只用于设置本地需要忽略的文件,而.gitignore是公共需要排除的。比如

    # git ls-files --others --exclude-from=.git/info/exclude
    # Lines that start with '#' are comments.
    # For a project mostly in C, the following would be a good set of
    # exclude patterns (uncomment them if you want to use them):
    # *.[oa]
    # *~
    # Compiled class file
    *.class

    # Log file
    *.log

    # BlueJ files
    *.ctxt

    # Mobile Tools for Java (J2ME)
    .mtj.tmp/

    # Package Files #
    *.jar
    *.war
    *.ear
    *.zip
    *.tar.gz
    *.rar
    zm-mc/target/
    zm-mc/.gitignore
    zm-mc/src/main/resources/rebel-remote.xml
    zm-mc/src/main/resources/rebel.xml
    .gitignore
    # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
    hs_err_pid*

       

  • 相关阅读:
    BZOJ1058:[ZJOI2007]报表统计(Splay,堆)
    BZOJ3224:普通平衡树(Splay)
    BZOJ3781:小B的询问(莫队)
    21. [HAOI2005] 希望小学 (wa1)
    cogs 2509. 森林大礼包
    libreoj #119. 最短路
    libreoj #514. 「LibreOJ β Round #2」模拟只会猜题意
    cogs 1647. 油田[uva572]
    css的部分应用示例
    html之表格
  • 原文地址:https://www.cnblogs.com/thinkingandworkinghard/p/7069121.html
Copyright © 2011-2022 走看看