There're two remote repos on github:
repo_course: course instructor regularly release new assignment skeleton code;
repo_me: my own with completed assignment code to grade;
It works like that:
git clone <repo_me url>: create local working repo on my computer which is empty
git add remote skeleton <repo_course url>
git pull skeleton master: fetch skeleton code, complete it, and push to repo_me
My question is:
Suppose that I pulled skeleton.java and rename or delete it, then I git pull skeleton master again, it won't restore. Why is that? It seems pull will add the new skeleton files only once at the first pull since last time. What's the benefits of its being designed like this?
What should I do if I indeed need to restore my deleted files from repo_course?
git pullmeansgit fetch && git merge: obtain their new work, then combine it with your work. So: Why do you believe Git should undo your work? You removed the file. He didn't touch the file. Git keeps your change.