Git
Git is a version control system, used for tracking changes to source code.
The bare minimum for syncing Git repos
I don’t need GitHub or a cloud service to keep my Git repos in sync – files and folders work just fine.
My Git config
How I set up Git on a new computer.
Opening all the files that have been modified in a Git branch
You can use Git to find where a branch diverged from
main, what files have changed, then open those files in your editor.A Python function to ignore a path with .git/info/exclude
If your Python script creates a file that you don’t want to track in Git, here’s how you can ignore it.
Use
git check-ignoreto debug your.gitignoreRunning
git check-ignore --verbose <PATH>will tell you which rule applies to a given path, and where that rule is defined.Add a Git co-author credit with “Co-authored-by” in your commit message
Pushing with
--force-with-leaseis safer than with--forceIt checks the remote state of the origin hasn’t changed since you last fetched, so you don’t risk overwriting anybody else’s commits.
List all Git object IDs and their type
Notes on A Plumber’s Guide to Git
Git is a fundamental part of many modern developer workflows – but how does it really work under the hood? In this workshop, we’ll learn about the internals of Git.
Pruning old Git branches
Two commands for managing Git branches: one for deleting branches which have already been merged, one for deleting branches which were deleted on a remote.
A plumber’s guide to Git
How does Git work under the hood? How does it store information, and what’s really behind a branch?
Some useful Git commands for CI
A couple of Git commands that I find useful in builds and CI.
Useful Git features: a per-clone exclude file (.git/info/exclude)
Another way to ignore untracked files in Git.