I just tried transferring my files for a specific repository to my local computer in a different directory and it seems to have failed.
After copying the source files to a new folder, I used the following to try and commit to the original GitHub repository by doing the following in a new directory:
git init
git add .
git commit -m 'migration'
git remote add origin https://github.com/UN/REP.git
git push origin master
This (as I got used to git by now) threw me an error:
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/UN/REP.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
I don’t know why this could be so, I just naively forced to click
git push -f origin master
Now, none of the files has saved its change history, since the repository shows only one (forced) commit.
Is there any way to return the change history for this repository?
/ , 1) , , 2) , , .git , , .