Monday, October 1, 2018

Useful Git commands


To reset your master branch
git reset --hard origin/master
To remove directory
git clean -d -f
To know the repository url
git remote show origin
To remove unused branch from local
git remote prune origin prunes tracking branches not on the remote.
git branch --merged // lists branches that have been merged into the current branch.
xargs git branch -d //Deletes branches listed on standard input.
##Be careful deleting branches listed by git branch --merged. The list could include master or other branches you'd prefer not to delete.
To give yourself the opportunity to edit the list before deleting branches, you could do the following in one line:
git branch --merged >/tmp/merged-branches && vi /tmp/merged-branches && xargs git branch -d

.htaccess display error pages on http errors

In your htaccess file add the below lines and save to show error pages on Http errors (404, 403 etc) ErrorDocument 403 /errors/404.html ...