How to use gitignore command in git

前端 未结 7 928
天命终不由人
天命终不由人 2021-01-29 18:27

I\'m working first time on git. I have pushed my branch on github and it pushed all the library and documents into the github. Now what can I do and how can I use gitignore comm

7条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-29 19:03

    There are several ways to use gitignore git

    • specifying by the specific filename. for example, to ignore a file
      called readme.txt, just need to write readme.txt in .gitignore file.
    • you can also write the name of the file extension. For example, to
      ignore all .txt files, write *.txt.
    • you can also ignore a whole folder. for example you want to ignore
      folder named test. Then just write test/ in the file.

    just create a .gitignore file and write in whatever you want to ignore a sample gitignore file would be:

    # NPM packages folder.
    node_modules
    
    # Build files
    dist/
    
    # lock files
    yarn.lock
    package-lock.json
    
    # Logs
    logs
    *.log
    npm-debug.log*
    
    # node-waf configuration
    .lock-wscript
    
    # Optional npm cache directory
    .npm
    
    # Optional REPL history
    .node_repl_history
    
    # Jest Coverage
    coverage
    
    .history/
    

    You can find more on git documentation gitignore

提交回复
热议问题