Skip to content

Instantly share code, notes, and snippets.

@c02y
Created July 19, 2018 10:52
Show Gist options
  • Save c02y/ed709f5a6558594cd019b2d477ff216a to your computer and use it in GitHub Desktop.
Save c02y/ed709f5a6558594cd019b2d477ff216a to your computer and use it in GitHub Desktop.
git command for multiple files copy/paste
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