gpt4 book ai didi

gitignore 没有扩展名的二进制文件

转载 作者:IT王子 更新时间:2023-10-29 01:20:49 29 4
gpt4 key购买 nike

如何使用 .gitignore 文件在 git 中忽略二进制文件?

示例:

$ g++ hello.c -o hello

“hello”文件是一个二进制文件。 git 可以忽略这个文件吗?

最佳答案

# Ignore all
*

# Unignore all with extensions
!*.*

# Unignore all dirs
!*/

### Above combination will ignore all files without extension ###

# Ignore files with extension `.class` & `.sm`
*.class
*.sm

# Ignore `bin` dir
bin/
# or
*/bin/*

# Unignore all `.jar` in `bin` dir
!*/bin/*.jar

# Ignore all `library.jar` in `bin` dir
*/bin/library.jar

# Ignore a file with extension
relative/path/to/dir/filename.extension

# Ignore a file without extension
relative/path/to/dir/anotherfile

关于gitignore 没有扩展名的二进制文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5711120/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com