It’s quite easy to use git clone or git pull/push to manage open-source code, but git can do much more than this.
Setting Up Proxy
It sometimes suffers when using git commands in certain countries, the following code shows how to set up ssh proxy for git commands:
Sparse Checkout
Sparse checkout is used to checkout only selected files or directories instead of the entire repository, which is especially helpful when managing large projects. [1]
Let’s take ctf-wiki/ctf-challenges as an example:
Stop Leaking Secrets
I’m going to introduce a useful light tool here: https://github.com/gitleaks/gitleaks , which can alert you and stop your commit when the result of git log -p might contain sensitive keys.
It’s simple to install and use it as a command line tool, having brew package for mac users and nixpkgs for my NixOS.
Its default config is strict enough for me so I won’t talk about custom configuration here.