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…

Enable SSL on BitBucket Server

bitbucket server

BitBucket Server alloow you to host git repositories. By default bitbucket server have url in following format

To install SSL, first point a domain to the server IP. Install nginx

Now install LetsEncrypt

Get SSL in standalone mode. We use standalone mode because nginx will proxy all request to bitbucket server, so […]

Read More…

Git Ignore file Permission (chmod)

Git SCM

Some times when you transfer file to web server, you may need a differnt file permission for files to run in web server, if your code is in git, this make the files marked as modified eventhough file contents are the same. To avoid git checking for file permission (chmod), run following command

See […]

Read More…

Git stdin is not a tty

When i push to get respo, i get error

Other than this error on push and pull, everything worked fine. SOLUTION 1 Add following to top of file /home/git/.bashrc

Modified .bashrc on my server

SOLUTION 2 The problem is fixed by

This is caused on cpanel servers (i have installed gitosis […]

Read More…

PHP Script to pull changes from GIT Repository

Here is a PHP script, that pulls the latest code from Git Repository to your website.

https://gist.github.com/serverok/7efc12fcd75aac21309dbe234d9030f6 Upload the file to your web server as git-pull.php, access it with URL

For this script to work, your web server should work as the user that owns the files. If your webserver runs as www-data, […]

Read More…

Git

Monitor file changes in your Website PHP Script to pull changes from GIT Repository How to protect .git folder using htaccess Git stdin is not a tty Git Ignore file Permission (chmod) Show git branch in terminal Color git command line result How to block .git directory in nginx Git Hooks Auto push after git […]

Read More…

git log

To see got commit log, type

To see logs in one line, run

To see one line grap, use

or

git […]

Read More…