Skip to content

Instantly share code, notes, and snippets.

@yusufhm
Last active February 18, 2019 00:58
Show Gist options
  • Save yusufhm/2eaf3d8235904292373f to your computer and use it in GitHub Desktop.
Save yusufhm/2eaf3d8235904292373f to your computer and use it in GitHub Desktop.
git commands
# ignore local changes to the .gitconfig file
git update-index --skip-worktree .gitconfig
# list skipped files
git ls-files -v | grep ^S
# revert the above
git update-index --no-skip-worktree .gitconfig
# list modified & new files
git ls-files --modified --others --exclude-standard /path/to/limit
# copy modified & new files
cp $(git ls-files --modified --others --exclude-standard /path/to/limit) path/to/which/to/copy/files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment