Created
July 19, 2018 10:52
-
-
Save c02y/ed709f5a6558594cd019b2d477ff216a to your computer and use it in GitHub Desktop.
git command for multiple files copy/paste
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 gitco -d 'git checkout -- for multiple files at once' | |
# when you copy/paste using mouse, the strings you pasted are not seprated by space ACTUALLY, using ',' | |
set -l files (echo $argv | tr ',' '\n') | |
for i in $files | |
echo 'git checkout -- for file' $i | |
git checkout -- $i | |
end | |
end | |
function gita -d 'git add for multiple files at once' | |
set -l files (echo $argv | tr ',' '\n') | |
for i in $files | |
echo 'git add for file:' $i | |
git add $i | |
end | |
end | |
function gitrh -d 'git reset HEAD for multiple files' | |
set -l files (echo $argv | tr ',' '\n') | |
for i in $files | |
echo 'git reset HEAD for file:' $i | |
git reset HEAD $i | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment