Github user magicmonty came up with a nice useful bash git prompt. For people using Linux Mint (like me) and looking to keep the prompt as similar to the default one as possible (like me), you will want to add this to your .bashrc
:
GIT_PROMPT_START="_LAST_COMMAND_INDICATOR_ ${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[00m\]" GIT_PROMPT_END=" $ " source ~/.bash-git-prompt/gitprompt.sh
The same as above, just mimicking the Cygwin default prompt:
GIT_PROMPT_START="\n_LAST_COMMAND_INDICATOR_ \[\e]0;\w\a\]\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]" GIT_PROMPT_END=" \n$ " source ~/.bash-git-prompt/gitprompt.sh
.gitignore
generated/ /temp/ *.bak
git update-index –assume-unchanged <file>
git checkout HEAD <file>
git reset –hard HEAD
git clean -f
git add <file>; git commit –amend
git reset [–hard | –soft]] HEAD^
git branch <branchname> [<sha> | HEAD^ | <branchname>]
git checkout <branchname>
git branch -d|-D <branchname>
git commit; git checkout <dest-branch>; git merge <src-branch>
git mergetool; git add <filename>; git commit
git reset –hard HEAD; git merge –abort
git reset –hard ORIG_HEAD
git reflog
git clone <repo-url>
origin/master
git branch <branchname> <remote-branch>; git checkout <branchname>
git fetch
git push
(only if fast-forward possible in remote)git pull
git branch new-local-branch; git checkout new-local-branch; git push –set-upstream origin local-branch
git push –delete origin <branchname>
git fetch –prune; git config –global fetch.prune true
git config --global pretty.gim "%C(blue)%ar%x09%C(yellow)%h%x09%C(cyan)%aN%x09%C(reset)%s%x09%C(auto)%d" git config --global format.pretty gim