Nov. 30, 2025
What I Learned
Sensitive information (API keys, private keys, configuration files, etc.) that has been accidentally committed continues to remain in Git’s history even with normal deletion. By using git filter-repo, you can rewrite Git history and completely remove sensitive information. However, removing from history does not make already leaked credentials safe, so you must always revoke and reissue the relevant credentials.
Details
Background
Previously, methods using git filter-branch were introduced, but warnings are now issued in the official documentation, and when creating new procedures, the use of git filter-repo is recommended.
Nov. 28, 2025
What I Learned
I organized a workflow for using Git solely locally, without using remotes like GitHub, aimed at Git beginners and individual developers. Since Git inherently keeps all history locally, understanding local Git before learning about remotes makes it easier to handle and less confusing. Backups (pseudo-remote/mirror) are possible even within local environments.
Details
Benefits of Using Git Locally Only
- Fewer concepts to learn, easier to study
- No risk of bothering others
- Can focus on Git’s essence (managing change history)
1. Basic Operations and Workflow
1-1. Repository Creation and Status Checks
1-2. Recording Changes Flow
1git add .
2git commit -m "work description"
1-3. Checking Status and History
1git diff
2git log --oneline --graph --decorate
1-4. Branch Operations
1git switch -c feature
2git switch main
3git branch -d feature
2. Reverting to Past Versions (Recovery Commands)
2-1. Restore Files Only
2-2. Undo the Last Commit (Keep Work Contents)
2-3. Rewind Commits and Changes (Destructive)
2-4. Revert to a Specific Commit
1git reset --hard <commit-id>
2-5. Undo Without Breaking History
2-6. Reference Past State
1git switch --detach <commit-id>
3. Backup (Local Pseudo-Remote + Mirror)
Git “remotes” don’t have to be URLs; you can register local folders as remotes.
Nov. 27, 2025
What I Learned
I usually develop on a Mac, but recently I’ve had more opportunities to teach development to Windows users. So I organized the procedure for setting up a development environment on Windows. With the combination of WSL2 + Ubuntu + Git + VS Code, you can build a comfortable Linux development environment on Windows similar to Mac. It’s lighter than virtual machines and file sharing with Windows is smooth.
Nov. 19, 2025
What I Learned
I learned how to remove unwanted file changes from a specific commit in a Pull Request. By combining git rebase -i and git commit --amend, you can pinpoint and modify past commits while keeping the history clean.
Details
The Problem
When creating a PR and checking the diff, I found that a certain commit had unintentionally changed a file:
D example/config.yaml (deleted)
It’s common to accidentally include unrelated changes such as configuration files or documentation in commits. This prevents the PR from being properly reviewed, so I needed to fix only that specific commit.
Nov. 5, 2025
What I Learned
Git’s interactive rebase (git rebase -i) is a powerful tool for cleaning up commit history before pushing changes. It allows you to reorder, squash, edit, or remove commits.
Details
Interactive rebase opens an editor with a list of commits and commands:
Available commands:
pick - use commit as-isreword - change commit messageedit - stop for amendingsquash - combine with previous commitfixup - like squash but discard commit messagedrop - remove commit
Example workflow: