What I Learnt Today 2022-01-21
在 Kubernetes Pod 和本地机器之间复制文件
使用 kubectl cp
命令
Options: -c, --container='': Container name. If omitted, use the kubectl.kubernetes.io/default-container annotation for selecting the container to be attached or the first container in the pod will be chosen --no-preserve=false: The copied file/directory's ownership and permissions will not be preserved in the container Usage: kubectl cp <file-spec-src> <file-spec-dest> [options]
示例
1 | # !!!Important Note!!! |
WSL 中 git status
显示 git 仓库内的文件全部处于已修改状态
我有一些在 Windows 下创建的仓库。当运行 git status
时,它显示该分支中的所有文件都是最新的,除了几个未跟踪的文件外,
没有任何未提交的文件。当我在 Windows 的 Ubuntu WSL 上用 bash 运行 git status
时,它显示我的所有文件似乎都被修改了,
并且没有被缓存提交。
这个问题是由于 Windows 和 Linux 默认的换行符不一样导致的,只要在 WSL 执行这个命令就可以了:
1 | git config --global core.autocrlf true |