Color git command line result

On CentOS, when i run git commands like “git status” or “git diff”, the result is shown with out any color. On Ubuntu, git always show result in color. To make git result show in color, edit file

Add

Now git commands will show output with color. […]

Read More…

Show git branch in terminal

show git branch in terminal

When working with git, to avoid accidental commit to wrong branch, it will be better if terminal show the branch name you are currently in. To display “git branch” in terminal, edit .bashrc

Add following code to end of the file.

You will need to restart terminal after making changes to ~/.bashrc file […]

Read More…

Auto push after git commit

Git hook allow you to perform tasks when some changes happen on a git repository. To automatically push code when you make a commit, create hook file .git/hooks/post-commit

Add

Thats all. Unlike normal bash scripts, git hooks don’t need 755 permission to run. Example

See git […]

Read More…