Skip to content

Instantly share code, notes, and snippets.

@hieunguyentrung
Last active September 8, 2019 23:41
Show Gist options
  • Save hieunguyentrung/b929cf007caa094e731c3d7b728e5864 to your computer and use it in GitHub Desktop.
Save hieunguyentrung/b929cf007caa094e731c3d7b728e5864 to your computer and use it in GitHub Desktop.
Git cheat sheet

https://stackoverflow.com/questions/36190800/how-to-disable-sparse-checkout-after-enabled

Revert modified files: git checkout -f

Remove untracked files: git clean -fd

sparseCheckout

git config core.sparseCheckout true
echo -e "/*\n!node_modules" >> .git/info/sparse-checkout

https://stackoverflow.com/a/33934496

.gitignore nor with .git/info/exclude

git update-index --assume-unchanged build/conf/a.conf

will achieve what you want: the files are always assumed unchanged

If you want to track changes in these files again, use --no-assume-unchanged.

Finally, if you want to know which files are currently in the --assume-unchanged mode, ask git for

git ls-files -v | grep -e "^[hsmrck]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment