I have been working on a series of exercises from a popular GitHub repository.
But unfortunately I have committed my answers
to the main
branch of their repository
. I should have cloned their repository first and then committed my changes to the cloned repository. Both of these are on GitHub.
Do I have a way to do this?: I don't want to loose my progress and redo the exercises, but more importantly I want to preserve the timestamps associated with my commits. I want to commit the answers to my clone (which is to be created) and then push the already committed commits to it.
All of guides/solutions to similar problems started with the clone first and then
Here is what I have done:
$ git clone repo_of_exercises.git
< Solved many exercises and I have a commit message for each exercise >
$ git add <solution to an exercise>
$ git commit -m "<Appropriate commit message>"
< Note that I have not pushed these changes, it's all on my computer >
What are the next steps that I should take to copy all of commits to a clone that I will create soon?