git config
The .gitconfig file in my home directory:
examples/gitconfig.txt
[user] name = Foo Bar email = foo@bar.com [alias] st = status co = checkout ci = commit # Check for conflicts before merging. See https://code-maven.com/git-check-for-conflicts-before-merge try = merge --no-commit --no-ff files = log --name-only lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit # git impact order --topo-order topo = log --color --topo-order --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit changed = diff-tree -r --no-commit-id --name-only last = changed HEAD # pull and update submodules pullall = !git pull && git submodule update --init --recursive plog = log --all --decorate --abbrev-commit --pretty=medium --graph meld = difftool --dir-diff [push] default = simple [core] excludesfile = /Users/gabor/.gitignore [difftool "sourcetree"] cmd = opendiff \"$LOCAL\" \"$REMOTE\" path = [mergetool "sourcetree"] cmd = /Users/gabor/Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" trustExitCode = true # Location of the commit message template file [commit] template = /Users/gabor/.stCommitMsg # git pull defaults to git pull --rebase [pull] rebase = true [diff] tool = meld [difftool] prompt = false [difftool "meld"] cmd = meld "$LOCAL" "$REMOTE"
Install meld for better comparing of files
sudo apt-get install meld
List of recently changed files:
git log --name-only --pretty=format:'' -n 20 | grep ^[a-zA-Z0-9] | sort | uniq
An alternative:
git log --before "2019-12-31" --after "2019-12-01" --name-only | grep -v ^commit | grep -v ^Author | grep -v ^Date: | grep -v '^ ' | grep -v '^$' | sort | uniq
git log --since="7 days ago"
will show the log for the last 7 days.
Maybe create a shell function:
function files() { git log --pretty=format:'' --name-only "$@" | grep \\S | sort | uniq }
and add it to ~/.bashrc
It allows us to write expressions like
files since="7 days ago"
that will show which files have changed in the last 7 days.
git log --before "2019-12-31" --after "2019-12-01"
Published on 2018-07-15