llorracc / as.180.369-2023-Fall

Johns Hopkins AS.180.369—“Tools for Writing a Research Paper in Economics” (Fall 2023)
1 stars 15 forks source link

How to properly create file + Accidentally lost my local file #13

Closed Sunsett5 closed 1 year ago

Sunsett5 commented 1 year ago

Hello, I kindly request assistance with file creation. I tried creating my own copy of Matt's ipynb file in my contrib folder on Jupyter Notebook. The created file doesn't show up in git status, so I create one with the same name on github directly. Then, I attempt to commit and push this file, but a divergent branch error prevents me from doing so.

I then git pull as recommended by the terminal. This seemingly overrode my local file with empty file on github, causing my local file to be unreadable. I am wondering what is the correct procedure—and if possible how to recover my file.

Thank you in advance.

Screen Shot 2566-10-05 at 19 30 58
Sunsett5 commented 1 year ago

It looks like my file is gone, but at least I think I understand how the push, pull, commit, work now. My working tree is "clean" for the first time.

All is good, I was able to recover the file by browsing my previous commits (that got pushed at the same time together with my latest commit).