How to delete files permanently from your local and remote git repositories
https://www.zyxware.com/sites/default/files/styles/user_image/public/default_images/index.png?itok=2YmREnrP
BY Anoop John
5 years ago
Free-Software
1
comments comment

If you frequently have to set up git version control system for existing projects then you would very likely run into the problem of having to remove files, which should not have been in git, from git after they were added. Running a git rm will only delete the file from the head and the file would still remain in the repository. This may be alright for small files but this could be troublesome for large files as these would unnecessarily bloat the git repository. But don't worry git being a 'swiss army knife' of version control systems there is a solution to delete files permanently from both your local and remote git repositories.

Do note that this is not a newbie solution and you have to do your bit of reading up on these commands and their implications before you actually run this on a production repository. Also note that you have to have RW+ permissions on the repository to do non-fast-forward pushes

CD to your local working folder and run the following command

git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch FOLDERNAME" -- --all

replace FOLDERNAME with the file or folder you wish to remove from the given git repository.

Once this is done run the following commands to clean up the local repository

rm -rf .git/refs/original/
git reflog expire --expire=now --all
git gc --prune=now
git gc --aggressive --prune=now

Now push all the changes to the remote repository

git push --all --force

This would clean up the remote repository.

Now you will have to recreate the .git folders of all the working copies of the repository. This would include cloned repositories by other developers or the cloned repositories at the live and dev sites. You can do this by cloning the repository afresh into a temporary folder and the move the .git folder from the newly cloned repository to the local repository after deleting the existing .git folder from in there. Do remember to checkout the same branch as is already checked out in the local repository in the temporary repository before you move the .git folder to the local repository.

Remember to make a backup copy of the latest repository and the latest local files before you do any of these things so that you can fall back to a working repository if you run into issues.

Do this if you are confident of your git capabilities or else call up the experts :-). Let us know and we will be happy to offer our offshore Drupal development services to help you maintain your server and your repositories.


RELATED ARTICLE

close

on 22nd February 2007 / by webmaster
We started zyxware with a vision to play an active role in changing the world around us positively. We are happy to announce the pilot mode launch of our first community initiative - Freelance@Zyxware. Through this project we hope to empower the student community technologically and financially. We hope that this would also give them a wonderful opportunity to learn and try new technologies, interact with other students with similar likes and the best part - get paid for doing this. Additionally we hope to nurture and build a forum of students through this project to promote FOSS, entrepreneurship, other open ideas, and similar initiatives. You can read more at Freelance@Zyxware Community Projects Free Software Drupal Contributions Leave a reply Your email address will not be published. Required fields are marker *
more_horiz
close

on 07th May 2007 / by webmaster
If your blog supports UTF-8 encoding then it is very easy to write and comment in Malayalam in your blog. This method should also be applicable for any of your sites that support UTF-8. Your website should support storage of UTF-8 characters in your application's database and also you should have a<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> in your pages where you want to read or write Malayalam This is a modification on the tool Varamozhi Offline that allows you to save an html page on to your system and use that to type in Malayalam. The original code for Varamozhi Offline is from Alex benenson's cyrillic translitarator. Add the following lines of code in the page where you have the textarea or input box where you want to type in Malayalam. <script type="text/javascript"> textControlID = "yourTextControlName"; </script> <script type="text/javascript" src="http://www.zyxware.com/freeware/mozhi_script/mozhi_script.js"> </script> Make sure that you replace yourTextControlName with the name of the text control where you want to type in Malayalam. The original code has only been slightly modified to enable inclusion in any page. We are planning to add some more features like conversion of selected text, realtime display of text being typed etc. Do check back for more updates. Malayalam Open Source Free Software Leave a reply Your email address will not be published. Required fields are marker * V (not verified) access_time 25 Mar 2019 - 22:28 Check out Scripto - http://www.writeka.com/scripto/. Allows you to type in malayalam and post directly to blogs. ITGalary Forum (not verified) access_time 25 Mar 2019 - 22:28 Really helpfull. I am planning to integrate it to my site. www.itgalary.com suraj (not verified) access_time 25 Mar 2019 - 22:28 send to me malayalam writing software webmaster access_time 25 Mar 2019 - 22:28 In reply to malayalam writing software by suraj (not verified) You can follow the instructions in the article to enable writing and reading in malayalam Add new comment
close

on 04th October 2007 / by webmaster
A new software developed by Zyxware Technologies all about to revolutionize the way information is collected and processed in tracking diseases like Chikungunya, Dengue, Malaria. The software, is being dedicated to the nation as Free Software under the GNU General Public License (GPL) on 5th October 2007. The first copy of the software will be handed over to the Hon'ble Minister for Health Smt. P. K. Sreemathi Teacher in a function to be held at the minister's office. The software is web based and allows Hospitals to report cases of diseases as soon as the case is registered at the hospital. The software seamlessly integrates with the existing manual process by allowing hospitals that does not have any web access to send paper based reports to data entry operators who can enter them into the system or send soft copies of the reports that can be imported automatically. The system allows secure login with role based privileges for different roles like Government Medical Official, Hospital Staff, Data Access Operators and System Administrator. The GIS interface uses Google maps to present the data on a real time basis on a map of the state. Cases of diseases are represented by markers on the map and easy visual analysis of the pattern and extent of spread of diseases is possible. The GIS and reporting interface processes the cases registered and presents reports that can be used by the Health Department to monitor the situation on a real time basis and take precautionary measures if required. Such a system will help in preventing occurrences of disease outbreaks of the scale experienced by the State of Kerala in the last couple of years. It is for the first time that such a software is being developed and released as free and open source software. One of the objectives in releasing the software as Free and Open Source Software is to promote the fact that it is possible to Develop state of the art software at very low costs and a developing country like India does not have to languish behind other IT leaders in any areas and To inspire youngsters to take bold steps in trying out their ideas and following their dreams instead of orthodox careers. Accessing the Demo A demo of the application has been set up at Health Monitoring System. The application has two modules - GIS/Report Interface and Management Console. The GIS interface displays reports and graphs of the collected data. Data collection and statistical analysis are/can be done in the Management Console. You can access the two modules at Health Monitor GIS/Reporting Interface Health Monitoring System Management Console The Management Console provides access to 3 different types of users 1) System Administrator username: admin password: zyxware 2) Hospital User username: hospital password: zyxware 3) Government Medical Officer username: gmouser password: zyxware 4) Data Access Operator username: daouser password: zyxware The source code for the application will be uploaded to sourceforge soon. Till then you can request a free copy of the software by sending us a request using the Contact Us page Why are we giving this software for FREE To promote the fact that it is possible to develop state of the art software at very low costs and a developing country like India does not have to languish behind other IT leaders in any areas Open Source is the way to go for a developing country like India. Low costs, no forex outflow through purchase of expensive software. Cost will never be a hurdle in any of our IT projects if we depend on Open Source Technologies and Open Source Solutions It is possible to get private companies to undertake Open Source projects without the government having to pay exorbitant prices or compromising on quality. To inspire youngsters to take bold steps in trying out their ideas and following their dreams instead of orthodox careers. Challenge to todays youth – Taking risks to achieve much more than a labor selling proposition offered by todays IT service export business. American IT industry grew because of the risk taking attitude of the Americans. There is nothing that is going to stop from become as good or better than America in IT. IT is not just selling labour to the International market. It should also mean creation of innovative solutions and products that can address our local needs. Announcements Open Source Press Releases Web Development Free Software Leave a reply Your email address will not be published. Required fields are marker * Subhash Krisha… (not verified) access_time 25 Mar 2019 - 21:45 I express my appreciation for exceptional work done by you and your team. The objectives in releasing the software as Free and Open Source Software will definitely be an inspiration to millions of Youth who aspire to see our Great India a developed country by 2020. I hope this will inspire youngsters to take bold steps in trying out their ideas and contributing it to our country, however small their contributions may be. I send my warm regards and wish you continued success. Subhash Krishanamoorthy Resmi G (not verified) access_time 25 Mar 2019 - 21:45 My Hearty congrats to zyxware team!!!! Hope this software will go a long way in tackling epidemics like chikungunya. It will be a boon to milliions of people like me who are suffering from chikungunya. The main hurdle at the clinical level for epidemics like chikungunya is that no medicines have been identified for treating this disease. Doctors just prescribe pain killers and paracetamol. The need of the hour is a sincere effort at the govt level to do extensive research for the roots of this disease , develop preventives and prevent such outbreaks in future. Such efforts aided with a GIS software like zyxwares’s will go a long way in eradicating these epidemics. Jai (not verified) access_time 25 Mar 2019 - 21:45 Kudos. I appreciate the effort and contribution from the Zyxware Technologies Team. I hope it would be possible to import the data (both demographic & clinical) collected through Electronic Medical Records (EMR’s) and Hospital Information Systems (HIS) database into the above mentioned modules (Health Monitoring System Management Console and Health Monitor GIS/Reporting Interface application), to generate disease patterns/trends, analyse reasons for occurrance, predict possiblity for future outbreaks for prevention etc. Such a feature/effort could help acheive better results in public health administration in India and other developing countries. Best Wishes Jai Sri Sathya Sai Information Technology Centre Prasanthi Nilayam Sukhdev Singh (not verified) access_time 25 Mar 2019 - 21:45 Please announce the URL from which this Open Source software can be downloaded. Brig K S Kali Prasad (not verified) access_time 25 Mar 2019 - 21:45 A very good effort and well organized GIS Information using the OGC to be studied for all cost effective projects Add new comment
Leave a reply
Your email address will not be published. Required fields are marker *

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
The content of this field is kept private and will not be shown publicly.
CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

author-image
Bruce Edge (not verified)
access_time 25 Mar 2019 - 22:28

Should you not also use "--tag-name-filter cat " as well?

Using the above command, I get may warnings like:
WARNING: You said to rewrite tagged commits, but not the corresponding tag.
WARNING: Perhaps use '--tag-name-filter cat' to rewrite the tag.