What I am interested in doing is creating an alias that adds all files, commits with a message, does a pull, if there are any conflicts stop and show a list of conflicted files, otherwise push.
I have already found an alias to list conflicted files (git config --global alias.conflicts "diff --name-only --diff-filter=U"
), but I have no idea how to integrate the rest of the commands.
Is it even possible to create an if
statement in this format?
Pseudo code (multi-line for readability):
git config --global alias.commitall '!func(){ git add -A && git commit -am "$1" &&
git pull && <conflict detection and possible die of command> &&
git push; }; func'