一个完整的 Git 提交流程
· ☕ 1 分钟
这也是一个给开源项目提交 PR 的完整 Git 流程。 1. 本地配置 提交用户信息 1 2 git config --global user.name "username" git config --global user.email "[email protected]" GPG 配置 参考:GPG 验证提交 2. 克隆代码 首先 fork 原仓库 克隆 fork 的仓库代码 1 git clone https://github.com/yourname/django-xss-cleaner.git 添加原仓库 1 git remote add upstream https://github.com/shaowenchen/django-xss-cleaner.git 查看本地配置的远程源 1 2 3 4 git remote -v origin xxx upstream xxx 3. 日常开发 拉取最新

GitHub 三种合并代码方式的差别
· ☕ 1 分钟
1. Create a merge commit PR Commit 记录: 1 2 commit c1 commit c2 集成分支 Commit 记录: 1 2 3 commit PR #NUM commit c2 commit c1 Create a merge commit 会将 PR 中的全部 Commit 记录完整带到集成分支中,同时增加一条 PR Commit 信息。 2. Squash and merge PR Commit 记录: 1 2 commit s1 commit s2 集成分支 Commit 记录: 1 commit PR #NUM Squash and merge 合并之后,集成分支只会增加一条 Commit 记录。观感

当我们值工单时,在值什么
· ☕ 2 分钟
1. 当我们值工单时,在值什么 一般人可能只提过工单,没值过工单。值过工单的人一般不会轻易提工单。 工单就是客户花钱买产品,赠送的一服务,专门解决各种使用上的问题。在云基础设施的厂商很常见,IaaS、CDN、Domain、Container 等,不会

Jenkins 中 Git 操作 not a tree 分析
· ☕ 3 分钟
1. 问题描述 配置 Webhook 自动触发执行 Jenkins 流水线时,报错: 1 2 3 hudson.plugins.git.GitException: Command "git checkout -f 23b446ea" returned status code 128: stdout: stderr: fatal: reference is not a tree: 23b446ea 2. Git 如何管理版本 Git 是一个内容寻址文件系统。Git 维护着一棵 sha tree ,通过 sha 值可以回溯到任何一个历史节点。先看看提交记录: 执行命令: 1 2 3 4 5 6 7 8 9 10 11 12

如何配置高效的 Kubernetes 命令行终端
· ☕ 1 分钟
磨刀不误砍柴工,无论什么时候,花点时间在工具链上都是值得的。 1. 自动补全 - kubectl OS X 安装命令: 1 brew install bash-complete@2 不仅仅是 kubectl ,也给其他命令行提供自动补全的命令提示。 在 .zshrc 中添加如下内容: 1 2 # kubectl complete source <(kubectl completion zsh) 在输入 kubectl get pod 命令时,键入 Tab 会自动列举当前类型下的资源,如