Created
October 8, 2021 02:43
-
-
Save itsjohncs/09613632e79c3d72fbc2ee0a4b6c4f87 to your computer and use it in GitHub Desktop.
Copies the file name of the next modified file in a git repo, or the next untracked file if there's no modified files.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gn { | |
printf 'Copied "' | |
( git ls-files -m; git ls-files -o ) | head -n 1 | tr -d '\n' | tee >(pbcopy) | |
printf '"\n' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment