A simple solution to a tricky command-line problem
From Hacker News
132 points
When branch names collide with command options
Practical implementation examples
# Traditional approach with --
git checkout -- -new-feature
# New explicit approach
git checkout --end-of-options -new-feature
# Useful in scripts for clarity
git log --end-of-options --some-branch
The --end-of-options flag clearly separates options from arguments
Clear advantages for developers and teams
Self-documenting commands that clearly express intent
Prevents accidental option interpretation errors
Ideal for automation and CI/CD pipelines
Works alongside existing -- convention
Clearer git commands, fewer surprises