Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
379 views
in Technique[技术] by (71.8m points)

repository - Git pull - deleted files

I have a development server and a couple of production ones. I do commits from the dev to a remote repository and have git push production setup, that issues a pull from the production servers. I needed to remove a couple of directories with static files from being tracked so I did this

Remove an Existing File from a Git Repo (summary: did git rm --cached myfolders, and after that added to .gitignore the folders)

I have not yet committed the changes. The files show as deleted when doing git status

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

My concern is: will the 'deleted' files be removed from production servers (from disk) when git pull is being performed? I just want them untracked, but not deleted from disk.

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yes, if you pull a commit that includes deletions, the files will be deleted. You'll need to restore the files manually afterwards.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...