Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Add .gitigore file to git project

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

I haven't paid attention to this file before, but I recently read Huang Yong's "Architecture Adventure" and found it very useful.

The .gitigore file can be configured on its own.

I am using the configuration used in the book, which is concise and clear.

# Maven # target/#log#logs/# IDEA # .idea / * .iml # Eclipse # .settings / .metadata / .classpath.projectServers / # Mac # .DS_Store

In this way, these files will be automatically filtered out each time they are submitted. (I added the logs/ folder myself, and log4j configured the log output to the logs folder of the file root)

When submitting to the remote warehouse, you can avoid submitting some useless files.

How to add .gitigore files to previous projects

Here's a problem to solve. Files that don't need to be submitted can be filtered if they haven't been submitted before, but it won't work if they have been included in the version library with git.

Then we need to delete the file in the git library.

Let git stop tracking this file, submit it to the remote server, and delete the files we don't need to see on the remote server.

Git rm-cached file git pull

OK, so that our remote warehouse does not have those unnecessary files.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report