Skip to content

Instantly share code, notes, and snippets.

@otech-nl
Last active December 1, 2016 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otech-nl/43d2f4bbaec73d8b85e2ce3eaf231e92 to your computer and use it in GitHub Desktop.
Save otech-nl/43d2f4bbaec73d8b85e2ce3eaf231e92 to your computer and use it in GitHub Desktop.
git tips
# extract a distributable archive, with changed files only (archive name derived from directory name and date):
alias git-diff="git diff --name-only HEAD^1 HEAD | zip ../${PWD##*/}-`date +%Y%m%d`-diff.zip -@"
# archive the current state:
alias git-archive="git archive --format=zip HEAD >../${PWD##*/}-`date +%Y%m%d`.zip"
# silence annoying CLRF warnings with:
git config --global core.autocrlf false
# remember credentials
git config --global credential.helper store
# ignore files for an export or archive with .gitattributes:
.gitattributes export-ignore
.gitignore export-ignore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment