How to push to your repo a repository from a coding test
Who never had a coding test to do from a big company to be able to check out if you are able to code? I had to do that for a big company. My problem was that they send me a repository per email with all git and github already initialized. Meaning I was not able to send it out to my own repository on Github and show to the world what I was able to do.
I will show you how to do change that, and don’t worry it’s really simple.
1- What is my problem
When I was on my folder and tried to push it to my repository on Github with the command git push origin master
I got the response
This meant that my folder was still connected to the previous owner.
2- How to check that?
To check the owner of the repository simple check it out with this command
$ git remote -v
here is my result:
3- how to fix this?
3-1 Trouble to fix it!
I tried to fix it by simple adding my repo on the remote like this:
Then I created the repository on Github with
$ hub create
but this did not really worked out for me with an error:
3-2 How I did to fix it
I finally found out that I had to remove the previous remote with this command line:
$ git remove rm origin
and then add my remote with creating a folder on github
hub create
You can then double check if everything is ok
$ git remote -v
Everything is looking good.
I just need to push it to my Github with
git push origin master
some links where I found the infos: Stackoverflow / Stackoverflow 2 / Githubhelp