Git deleted files

I have a development server and several production ones. I make commits from the developer to the remote repository and have a git push production installation that provides the load from production servers. I needed to delete a couple of directories with static files in order to track them, so I did this

Delete an existing file from Git Repo (summary: did git rm --cached myfolders , and then added folders to .gitignore)

I have not made any changes yet. Files are displayed as deleted when git status executed

 # deleted: file1.jpg # deleted: file2.jpg # deleted: file3.jpg # deleted: file4.jpg # deleted: file5.jpg 

My concern is: are remote files deleted from production servers (from disk) when git pull is running? I just want them not to be tracked, but not deleted from the disk.

thanks

+4
source share
2 answers

Yes, if you pull a commit that includes deletes, the files will be deleted. After that, you will need to restore the files manually.

+10
source

Yes, the files will be deleted if you do git pull . Git could not do anything - suppose some of the code in the repository depended on the existence or absence of a file. Deleting a file can produce significant results, so Git should delete the file when clicked.

+5
source