####Alias for a formatted changelog###
git config --global alias.changes '!git log --oneline --decorate > changelog.txt'
To export a changelog text file to the current directory named changelog.txt run:
git changes
####Alias for a formatted changelog with branch trees###
git config --global alias.changes '!git log --pretty=oneline --abbrev-commit --graph --decorate > changelog.txt'
To export to changelog.txt, run:
git changes
####Limit remote pushes to only current branch##
git config --global push.default tracking
####Checkout an old commit to a new branch
git checkout -b <branch name> <commit hash>
####Git Submodules
Adding a module
git submodule add <module git url> <location to add it to>
for example
git submodule add https://github.com/storypioneers/kirby-selector.git site/fields/selector
Updating sub modules
$ git submodule update --init --recursive
$ cd your/project/root
$ git submodule foreach git checkout master
$ git submodule foreach git pull
$ git commit -a -m "Update submodules"