Git¶
History¶
To search history for commits affecting some file name
$ git log --all --full-history -- "**/pattern.*" # or can be an explicit file path
To show the changes included in a commit for a specific file
$ git show <sha> -- <filepath>
Rebasing¶
To include the root commit in a rebase use the --root
flag
$ git rebase -i --root
Submodules¶
To clone a repo that contains submodules we can run the following command
$ git clone --recurse-submodules <repo-url>
Or if you’ve already cloned a repo only to later discover that it contained submodules
$ git submodule update --init --recursive