git discard all local changes/commits and pull from upstream
git reset --hard origin/master
git pull origin master
| # the following command will convert all the files to HTML which has the DOC extension. | |
| find . -name "*.DOC" -type f -print0 |xargs -0 -I {} libreoffice --headless --convert-to html:HTML --outdir /home/nasir/output {} |
| /** | |
| * | |
| * Input any number in Bengali and the following function will return the English number. | |
| * | |
| */ | |
| function bn2enNumber ($number){ | |
| $search_array= array("১", "২", "৩", "৪", "৫", "৬", "৭", "৮", "৯", "০"); | |
| $replace_array= array("1", "2", "3", "4", "5", "6", "7", "8", "9", "0"); | |
| $en_number = str_replace($search_array, $replace_array, $number); |
| ``` | |
| #!/bin/sh | |
| for file in `ls *.html` | |
| do | |
| newname=`echo $file|sed 's/\.html$//g'` | |
| mv $file $newname | |
| done | |
| ``` |
| $url = "index.php"; | |
| redirect($url); | |
| function redirect($url) { | |
| if (headers_sent()) { | |
| die('<script type="text/javascript">window.location.href="' . $url . '";</script>'); | |
| } else { | |
| header('Location: ' . $url); | |
| die(); | |
| } |
git discard all local changes/commits and pull from upstream
git reset --hard origin/master
git pull origin master
Sometimes we need to keep a file in the project but do not want to track the changes, for example the config/configuration file or other setting file.
git has a solution to do this. First change the file you do not want to be tracked and use the following command.
git update-index --assume-unchanged FILE_NAME
and if you want to track the changes again use this command,
| git checkout gh-pages | |
| git merge master | |
| git push origin gh-pages |
| .clearfix:after { | |
| visibility: hidden; | |
| display: block; | |
| font-size: 0; | |
| content: " "; | |
| clear: both; | |
| height: 0; | |
| } | |
| .clearfix { display: inline-block; } | |
| /* start commented backslash hack \*/ |
| #!/bin/sh | |
| # Mirror master in gh-pages | |
| git checkout gh-pages | |
| git merge master | |
| git checkout master |