Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
383 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...