-
Delete all migrations of a Django project
find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
-
Delete
__pycache__
filesfind . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
-
Clear content file
echo -n "" > <file_name>
-
Check differences between two files
diff <file_name_1> <file_name_2>
-
Copy content into the clipboard from a file
pbcopy < <file_name>
Example:
pbcopy < git-logs.txt
-
Export git commits
git log --since="<date>" --author="<email or name>" --reverse --pretty=format:"%h,%an,%ar,%s" > <file_name>
Example:
git log --since="yesterday" --author="John Tamayo" --reverse --pretty=format:"- %s" > git-logs.txt
git log --since="last week" --author="John Tamayo" --reverse --pretty=format:"- %s" > git-logs.txt
git log --since="march 31 2019" --author="John Tamayo" --reverse --pretty=format:"- %s" > git-logs.txt
git log --since="03-31-2019" --author="John Tamayo" --reverse --pretty=format:"- %s" > git-logs.txt