Git
Git is a version control system, used for tracking changes to source code.
5 articles
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.
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.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.
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.
6 notes
My Git config
How I set up Git on a new computer.
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