Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
push existing repository to github
cd existing_git_repo
git remote add origin git@github.com:[user]/[reponame].git
git push -u origin master
@Serhioromano

This comment has been minimized.

Copy link

commented Mar 14, 2011

I cannot understand this.

I have created a gist. Then I run

$ mkdir mygist
$ cd mygist
$ git init
$ git pull git@gist.github.com:869085.git

The I add files, change files and try to commit.

$ git add .
$ git commit -a -m "Better comments"

Then I do nto know how to send it back to github and commit this git. Could you please help?

@gonzalo123

This comment has been minimized.

Copy link
Owner Author

commented Mar 14, 2011

You need to set up the remote origin

@Serhioromano

This comment has been minimized.

Copy link

commented Mar 15, 2011

I do this

$ git remote add origin git@gis.......git
$ git push origin master

It returns error. After I setup origin how to push new data? Can you add example lines?

When I try to push here is what happening

$ git push -u origin
Enter passphrase for key '/c/Users/user/.ssh/id_rsa':
ERROR: Permission to 869085.git denied to MightyTechnologies/Mighty-Solution-CMS.
fatal: The remote end hung up unexpectedly

It asks me to enter passphrase. And i do not have any other passphase exept that one I created when setup my main repository. I enter that passphrase and I get fatal error.

@jcmarchi

This comment has been minimized.

Copy link

commented Jan 24, 2017

@Serhioromano,

Very old question, but I believe it may help others with same issue...

I believe you are trying to set your "origin" as SSL (based on the format of the link, which looks like is git@github.com:[useraccount]/[repositoryname].git). For you to use SSL you need to create a Secure Key, then install it in your system, so the "origin" will be able to recognize you when you try to use it.

Here more info: https://help.github.com/articles/which-remote-url-should-i-use/

You can try to create the KEY and use SSL (strongly recommended) or you can use HTTPS instead. You can get the link of the HTTPS in the button "clone or download" at your repository main page. Simply chose "Use HTTPS".

I hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.