aneta_bielska [:blog]

Git: remove data from server
#git

Once in a while I am pushing to server things I don’t really need there. Like I did recently and pushed my sqlite database. I want to keep the file localy but remove it only from a server.

It is very simple:

git rm --cached myfile_or_directory

then just commit and push changes:

git add . && git commit && git push

Thing to remeber is to add that file or directory to gitignore so that you will not push it again. If you don’t have one yet just create a file: .gitignore and list there all files you want to ignore. Like this:

myfile.rb
directory/
other_directory_example/my_other_file_example.js

You may also enjoy:


#servers (1) #hosting (1) #sinatra (2) #assets (1) #sprockets (1) #react-js (1) #data-mapper (1) #ROM (1) #sequel (1) #ORM (1) #pg (1) #sqlite3 (1) #postgresql (1) #ruby (4) #ubuntu (1) #heroku (1) #git (1) #css (3) #cors (1) #same-origin-policy (1) #rake (1) #web-scraping (1) #ruby-on-rails (1) #brug (1) #elixir (1) #benchmark (1)