Git Alias for initializing your repo
Great tip from a colleague for setting up your git repo for git flow. This is designed to be run on a new project folder before you start adding source code. It will initialize git and ensure that you’re on the develop branch to begin your work. Nothing elaborate, just a nice alias that I don’t want to lose track of when setting up a new machine.
[alias]
this = !git init && git commit --allow-empty -m \"Initialize Git Repo\" && git checkout -b develop && git add . && git commit -m \"Initial Commit\"
Add the above snippet into ~/.gitconfig
After adding the alias, create a new folder for your project and then run the command in it to initialize the repo and start your gitflow process off on the right branch!
mkdir my-new-project
cd my-new-project
git this
Date: May 14, 2017
Tags: