Git

· sillybit


The de-facto version control system. Remember who, what, when, where, and why it was changed.

It's also billed as being distributed, but most people store their code on GitHub. I might try Codeberg or SourceHut for feels.

Anyways, here's some examples.

git-status #

brief summary #

Shows a brief summary

[todd@nixos:~/nixos]$ git status -bs
## main...origin/main [ahead 2]
 M README.md
 M configuration.nix
 M keyd.nix
 M neovim.nix
 M tmux.nix
?? hardware-configuration.nix
?? notes.md
?? pass.nix
?? result
?? unstable.nix

git-log #

Logs are great, right? When you need them anyway. I don't need a blog if I keep a tidy git log.

Basically, if we consistently follow good practice and write, short, imperative commit messages, we can get a good overview of changes without talking

When apropos, tac --follow to trace all commits to a file. Here's an example from my nixOS configurations.

[todd@nixos:~/nixos]$ git log --follow configuration.nix
commit e315742fd69a70f881f48e3f5693cc4223b7e5e1 (origin/main, origin/HEAD)
Author: Todd Butters <todd@butters.io>
Date:   Mon Nov 20 20:57:17 2023 -0500

    Add atuin magic shell history config

    - Add atuin.sh
    - Update configuration.nix

    Puts bash, zsh, and fish shell history into a database and add fuzzy
    finding search to it and capability to sync across machines.

commit 9879dec96c0fcb28abd8f6a4943b48c7afb07aeb
Author: Todd Butters <todd@butters.io>
Date:   Sat Nov 18 16:17:47 2023 -0500

    Add zoxide smarter cd command config

    - Add zoxide.nix
    - Update configuration.nix

    Intuitive, intelligent, directory jumping program based on how recently
    and frequently you visit a directory in the shell.

commit 994bb649d202b36ec7f39ee720ebb61b64e5de05
Author: Todd Butters <todd@butters.io>
Date:   Sat Nov 18 09:02:44 2023 -0500

    Add keyd and remap caps lock to esc

    - Add keyd.nix
    - Update configuration.nix

    Flexible, system-wide key remapping daemon on Linux.
    Used primarily to make the Caps lock key useful.

commit 7b3a2e784e3256021799d3b87f2258e551670dc8
Author: Todd Butters <todd@butters.io>
Date:   Sat Nov 18 09:01:17 2023 -0500

    Add tmux terminal multiplexer configuration

    - Add tmux.nix
    - Update configuration.nix

commit 8053635dea22041ba12eb60c30a3e065c0536ec2
Author: Todd Butters <todd@butters.io>
Date:   Fri Nov 17 22:12:52 2023 -0500

    Add neovim text editor configuration

    - Add neovim.nix
    - Update configuration.nix

commit 4de25df66965a8349e9ed4318c9cee561fc013f6
Author: Todd Butters <todd@butters.io>
Date:   Fri Nov 17 21:29:04 2023 -0500

    Add basic configuration

    - Add configuration.nix

[todd@nixos:~/nixos]$

``