Skip to main content

How to remove folder properly from git repo


Step 1: Add required_folder_path/ to .gitignore file
Step 2:
$ git rm -r --cached required_folder_path/
or
$ git rm -r --cached .
sometime if warning occurs this command will not be completed for that use '--ignore-unmatch' option.
Therefore the it should be:
$ git rm -r --cached --ignore-unmatch required_folder_name/
Step 3: $ git add .
Step 4: $ git push

To undo
$ git rm --cached filename
$ git add filename

Comments

Popular posts from this blog

session_start(): Failed to initialize storage module: user (path: )

Error: session_start(): Failed to initialize storage module: user (path: ) Solution: When this error is given for the Codeigniter project you are running, that is specifically for not having a path recognised to store session data. Set config data as follows [file: your-project-folder/application/config/config.php] : $config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = APPPATH.'cache/'; $config['sess_match_ip'] = TRUE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = FALSE;