git配置指令设置

git配置指令应用整理

git config --list 查看git 配置

git config --get http.postBuffer 查看git缓存配置

git config --global http.postBuffer 524288000 配置git 缓存为500mb(1048576000)

git config --global core.autocrfl false 设置git换行符 不转换换行符

git config core.compression 0 设置压缩机别 0表示无压缩,-1为zlib默认压缩值,而1-9是速度大小集中的方案,最慢的是9

git config pack.SizeLimit 256m 设置一个包最大的压缩尺寸(输出包的最大大小)

git config pack.windowMemory 256m 每个线程在窗口中占内存大小(未配置时,无限制),窗口大小动态缩小,不超过配置数值,不会使大窗口内存用完

git config --global pack.threads 1 设置git 线程数

git config --global core.filemode false 设置文件格式(忽略权限变化)\不信任文件模式(跨系统文件复制和使用)

git config --global core.safecrlf true 拒绝提交包含混合换行符的文件

git config --global pack.depth “” 限制最大深度,默认值为50 最大为4095(影响解包方面的性能)
git config --global pack.window “” 窗口大小设置 默认为10(内部按照大小和可选的名称排序,所有对象窗口惊醒比较,)

git config --global user.name “” 设置用户名
git config --global user.email “” 设置邮箱地址(建议用注册giuhub的邮箱)

git config --system --unset credential.helper git 失败时清除缓存的密码


global/system/local区别:
–global 全局配置文件 ,配置文件位置:~/.gitconfig,优先级中
–system 系统配置文件,配置文件位置:$(prefix)/etc/gitconfig,优先级低
–local 特定配置文件,配置文件位置:$(git项目目录)/.git/config,优先级高

Options: --networkMessageCompressors arg (=snappy,zstd,zlib) Comma-separated list of compressors to use for network messages General options: -h [ --help ] Show this usage information --version Show version information -f [ --config ] arg Configuration file specifying additional options --configExpand arg Process expansion directives in config file (none, exec, rest) --port arg Specify port number - 27017 by default --ipv6 Enable IPv6 support (disabled by default) --listenBacklog arg Set socket listen backlog size --maxConns arg (=1000000) Max number of simultaneous connections --pidfilepath arg Full path to pidfile (if not set, no pidfile is created) --timeZoneInfo arg Full path to time zone info directory, e.g. /usr/share/zoneinfo -v [ --verbose ] [=arg(=v)] Be more verbose (include multiple times for more verbosity e.g. -vvvvv) --quiet Quieter output --logpath arg Log file to send write to instead of stdout - has to be a file, not directory --logappend Append to logpath instead of over-writing --logRotate arg Set the log rotation behavior (rename|reopen) --timeStampFormat arg Desired format for timestamps in log messages. One of iso8601-utc or iso8601-local --setParameter arg Set a configurable parameter --extensions arg Specify paths to extensions to load --bind_ip arg Comma separated list of ip addresses to listen on - localhost by default --bind_ip_all Bind to all ip addresses --noauth Run without security --transitionToAuth For rolling access control upgrade. Attempt to authenticate over outgoing connections and proceed regardless of success. Accept incoming connections with or without authentication. --slowms arg (=100) Value of slow for profile and console log --slowTaskWaitTimeProfilingMs arg (=50) Value of slow wait time for tasks --slowOpSampleRate arg (=1) Fraction of slow ops to include in the profile and console log --profileFilter arg Query predicate to control which operations are logged and profiled --auth Run with security --clusterIpSourceAllowlist arg Network CIDR specification of permitted origin for `__system` access --profile arg 0=off 1=slow, 2=all --cpu Periodically show cpu and iowait utilization --sysinfo Print some diagnostic system information --noscripting Disable scripting engine --notablescan Do not allow table scans --proxyPort arg The port that accepts connections with a proxy protocol header. --keyFile arg Private key for cluster authentication --clusterAuthMode arg Authentication mode used for cluster authentication. Alternatives are (keyFile|sendKeyFile|sendX509|x509) Replication options: --oplogSize arg Size to use (in MB) for replication op log. default is 5% of disk space (i.e. large is good) Replica set options: --replSet arg arg is <setname>[/<optionalseedhostlist >] --replSetName arg arg is <setname> Serverless mode: --serverless arg Serverless mode implies replication is enabled, cannot be used with replSet or replSetName. Sharding options: --configsvr Assigns the config-server role to this node in a sharded cluster. The default listening port is 27019 and the default database directory is /data/configdb. --shardsvr Assigns the shard-server role to this node in a sharded cluster. The default listening port is 27018. --routerPort [=arg(=27016)] Assigns the router role to this node in a sharded cluster, and results in listening to a dedicated port (27016 by default) to serve routing requests. --maintenanceMode arg Allows this node to skip starting up sharding components or both replication and sharding components. This allows for performing maintenance on this node. To skip setting up just sharding components use --maintenanceMode=replic aSet. To skip setting up both sharding and replication components use --maintenanceMode=standalone. --replicaSetConfigShardMaintenanceMode Bypasses validation of configuration mismatches between startup parameters and the stored replSetConfig. Enables restarting the node as a configsvr even if the stored configuration is for a replica set, and vice versa. Storage options: --storageEngine arg What storage engine to use - defaults to wiredTiger if no data files present --dbpath arg Directory for datafiles - defaults to \data\db\ which is C:\data\db\ based on the current working drive --directoryperdb Each database will be stored in a separate directory --syncdelay arg Seconds between disk syncs --journalCommitInterval arg how often to group/batch commit (ms) --upgrade Upgrade db if needed --repair Run repair on all dbs --validate Run validation on all collections --restore This should only be used when restoring from a backup. Mongod will behave differently by handling collections with missing data files, allowing database renames, skipping oplog entries for collections not restored and more. --oplogMinRetentionHours arg (=0) Minimum number of hours to preserve in the oplog. Default is 0 (turned off). Fractions are allowed (e.g. 1.5 hours) TLS Options: --tlsOnNormalPorts Use TLS on configured ports --tlsMode arg Set the TLS operation mode (disabled|allowTLS|preferTLS|requireTLS ) --tlsCertificateKeyFile arg Certificate and key file for TLS. Certificate is presented in response to inbound connections always. Certificate is also presented for outbound connections if tlsClusterFile is not specified. --tlsCertificateKeyFilePassword arg Password to unlock key in the TLS certificate key file --tlsClusterFile arg Certificate and key file for internal TLS authentication. Certificate is presented on outbound connections if specified. --tlsClusterPassword arg Internal authentication key file password --tlsCAFile arg Certificate Authority file for TLS. Used to verify remote certificates presented in response to outbound connections. Also used to verify remote certificates from inbound connections if tlsClusterCAFile is not specified. --tlsClusterCAFile arg CA used for verifying remotes during inbound connections --tlsCRLFile arg Certificate Revocation List file for TLS --tlsDisabledProtocols arg Comma separated list of TLS protocols to disable [TLS1_0,TLS1_1,TLS1_2,TLS1_3 ] --tlsAllowConnectionsWithoutCertificates Allow client to connect without presenting a certificate --tlsAllowInvalidHostnames Allow server certificates to provide non-matching hostnames --tlsAllowInvalidCertificates Allow connections to servers with invalid certificates --tlsCertificateSelector arg TLS Certificate in system store --tlsClusterCertificateSelector arg SSL/TLS Certificate in system store for internal TLS authentication --tlsLogVersions arg Comma separated list of TLS protocols to log on connect [TLS1_0,TLS1_1,TLS1_2 ,TLS1_3] --tlsClusterAuthX509ExtensionValue arg If specified, clients who expect to be regarded as cluster members must present a valid X.509 certificate containing an X.509 extension for OID 1.3.6.1.4.1.34601.2.1.2 which contains the specified value. --tlsClusterAuthX509Attributes arg If specified, clients performing X.509 authentication must present a certificate with a subject name with the exact attributes and values provided in this config option to be treated as peer cluster nodes. AWS IAM Options: --awsIamSessionToken arg AWS Session Token for temporary credentials WiredTiger options: --wiredTigerCacheSizeGB arg Maximum amount of memory to allocate for cache in GB; Defaults to 1/2 of physical RAM. Only one of either wiredTigerCacheSizePct or wiredTigerCacheSizeGB can be provided --wiredTigerCacheSizePct arg Maximum amount of memory to allocate for cache as a percentage of physical RAM; Defaults to 1/2 of physical RAM and a minimum of 256MB. Only one of either wiredTigerCacheSizePct or wiredTigerCacheSizeGB can be provided --zstdDefaultCompressionLevel arg (=6) Default compression level for zstd compressor --wiredTigerJournalCompressor arg (=snappy) Use a compressor for log records [none|snappy|zlib|zstd] --wiredTigerDirectoryForIndexes Put indexes and data in different directories --wiredTigerLiveRestoreSource arg Path to the source for live restore. --wiredTigerLiveRestoreThreads arg (=8) Number of live restore background threads. --wiredTigerLiveRestoreReadSizeMB arg (=1) 'The read size for data migration, in MB, must be a power of two. This setting is a best effort. It does not force every read to be this size.' --wiredTigerCollectionBlockCompressor arg (=snappy) Block compression algorithm for collection data [none|snappy|zlib|zstd] --wiredTigerIndexPrefixCompression arg (=1) Use prefix compression on row-store leaf pages Windows Service Control Manager options: --install Install Windows service --remove Remove Windows service --reinstall Reinstall Windows service (equivalent to --remove followed by --install) --serviceName arg Windows service name --serviceDisplayName arg Windows service display name --serviceDescription arg Windows service description --serviceUser arg Account for service execution --servicePassword arg Password used to authenticate serviceUser
最新发布
11-22
### 解决 MongoDB 启动时 `Data directory \data\db not found` 错误 该错误表明 MongoDB 默认的数据存储目录 `\data\db` 不存在。可以通过以下几种方法解决: - **创建默认数据目录**:在系统盘(通常是 C 盘)根目录下创建 `data` 文件夹,再在 `data` 文件夹内创建 `db` 文件夹。可以使用以下命令在命令提示符中完成: ```batch md C:\data\db ``` - **指定数据目录启动**:若不想使用默认的 `\data\db` 目录,可在启动 MongoDB 时通过 `--dbpath` 参数指定其他数据目录。例如,指定 `D:\mongodb_data` 为数据目录: ```batch mongod --dbpath D:\mongodb_data ``` - **修改配置文件**:通过修改 MongoDB 的配置文件 `mongod.cfg` 来指定数据目录。打开 `mongod.cfg` 文件,找到 `storage` 部分,修改 `dbPath` 为实际的数据目录路径: ```ini storage: dbPath: D:\mongodb_data ``` 修改完成后,使用配置文件启动 MongoDB: ```batch mongod --config "C:\Program Files\MongoDB\Server\8.2\bin\mongod.cfg" ``` ### MongoDB 启动选项详细介绍 - **`--dbpath`**:用于指定 MongoDB 存储数据的目录。例如,`mongod --dbpath D:\mongodb_data` 表示将 `D:\mongodb_data` 作为数据存储目录[^1][^2][^4]。 - **`--config`**:指定 MongoDB 的配置文件路径。如 `mongod --config "C:\Program Files\MongoDB\Server\8.2\bin\mongod.cfg"` 会按照 `mongod.cfg` 文件中的配置启动 MongoDB。 - **`--install`**:将 MongoDB 安装为 Windows 服务。配合 `--serviceName` 可以指定服务的名称。例如 `mongod --config "E:\software\MongoDB\Server\7.0\mongo.config" --install --serviceName "MongoDB"` 会将 MongoDB 以 `MongoDB` 为服务名安装到系统中[^3]。 - **`--serviceName`**:与 `--install` 配合使用,用于指定 MongoDB 作为 Windows 服务的名称。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值