git

Add Git Branch Name to Shell Prompt

PS1=’\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \w\[\033[0;32m\]\n$(git branch 2>/dev/null | grep “^*” | colrm 1 2)\[\033[0;32m\]??\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\]\[\033[0m\] ‘ Credit: https://gist.github.com/justintv/168835  

Details

Git Stash Commands

Most common commands that I use. Self-explanatory. Save and List Stash git stash save “Some message” git stash ...

Details

.gitignore file

Ignoring files in git using .gitignore ====================================== create a .gitignore file and put it in the root of ...

Details

Delete un-tracked files from git

Removing un-tracked files We can use git clean -f to clean up un-tracked files in the working directory. ...

Details

Changes to Git – Amend

1. Undo changes in the working directory git checkout — unmodifiedFileName # — implies that we are not ...

Details

Most Common Git Commands

git branch -b new_feature git branch –no-merged # show the branches that are not merged yet. git merge ...

Details

Viewing Git Logs

Some common git log comments that I use heavily. # view git logs git log #limit number of ...

Details

Sample initial git set up commands

This is a sample initial git set up commands I use for my projects. git config –system git ...

Details